﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Net;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using RxjhServer.DbClss;
using RxjhServer.HelperTools;
using RxjhServer.Network;

namespace RxjhServer
{
    public class World
    {
        public static int ver = 0;

        public static double ServerVer = 2.0;

        public static double ServerVerD = 0.0;

        public static string ServerRegTime = "";

        public static bool Droplog = false;

        public static string Key = "192.168.0.4";
        public static string Key2 = "192.168.0.4";

        public static AtapiDevice Keyk = new AtapiDevice();

        public static int AllItmelog = 1;

        public static bool AlWorldlog = true;

        public static bool Process = false;

        public static bool 线程同步变量 = false;

        public static int ServerIDStart = 0;
        //防CC简单策略
        public static int 上次IP连接数 = 0;
        public static int 本次IP连接数 = 0;
        public static int 被攻击CC防御剩余秒 = 0;
        public static int 被攻击叠加10秒 = 10;
        public static int 有攻击 = 0;
        public static int 被攻击防御次数 = 0;
        public static int 开启本线路势力战 = 1;

        public static int 世界时间事件累计秒 = 0;
        public static int 离线打怪位置 = 0;
        public static DateTime 离线挂机时间间隔 = DateTime.Now;

        //门派
        public static int 二级门派升级所需金钱 = 2000000;
        public static int 三级门派升级所需金钱 = 5000000;
        public static int 四级门派升级所需金钱 = 20000000;
        public static int 五级门派升级所需金钱 = 50000000;
        public static int 六级门派升级所需金钱 = 100000000;
        public static double 四级门派增加经验 = 0.01;
        public static double 四级门派增加爆率 = 0.01;
        public static double 五级门派增加经验 = 0.01;
        public static double 五级门派增加爆率 = 0.01;
        public static double 六级门派增加经验 = 0.01;
        public static double 六级门派增加爆率 = 0.01;


        public static int 宣战进程 = 0;
        public static int 复仇进程 = 0;
        public static EvePVPClass 宣战;
        public static EveFCClass 复仇;

        public static ThreadSafeDictionary<int, Players> eve90Players = new ThreadSafeDictionary<int, Players>();
        public static ThreadSafeDictionary<int, Players> eve80Players = new ThreadSafeDictionary<int, Players>();
        public static Dictionary<string, 冲关地图类> 冲关地图list = new Dictionary<string, 冲关地图类>();
        public static Dictionary<int, 石头属性调整类> 石头属性调整 = new Dictionary<int, 石头属性调整类>();

        public static ThreadSafeDictionary<int, NetState> list = new ThreadSafeDictionary<int, NetState>();

        public static Dictionary<string, EventTopClass> EventTop = new Dictionary<string, EventTopClass>();

        public static ThreadSafeDictionary<int, Players> allConnectedChars = new ThreadSafeDictionary<int, Players>();

        //public static ThreadSafeDictionary<int, Players> allConnectedChars = new ThreadSafeDictionary<int, Players>();

        public static Dictionary<string, DbClass> Db = new Dictionary<string, DbClass>();

        public static Queue m_Disposed = Queue.Synchronized(new Queue());

        public static Queue SqlPool = Queue.Synchronized(new Queue());

        public static Dictionary<int, double> lever;

        public static Dictionary<int, double> Patlever;

        public static Dictionary<int, 武勋加成类> Wxlever;

        public static Dictionary<int, 公告类> 公告;

        public static ThreadSafeDictionary<long, 地面物品类> ItmeTeM;

        public static List<首爆> Set首爆 = new List<首爆>();

        public static Dictionary<int, MapClass> Map = new Dictionary<int, MapClass>();

        public static Dictionary<int, MonSterClss> MonSter;

        public static Dictionary<int, ItmeClass> Itme;

        public static Dictionary<int, 武功类> TBL_KONGFU;

        public static Dictionary<int, 组队Class> W组队;

        public static Dictionary<int, 帮战Class> 帮战list = new Dictionary<int, 帮战Class>();

        public static List<ShotClass> Shot;

        public static List<检查物品类> 物品检查;

        public static List<KillClass> Kill;

        public static List<DropClass> Drop;

        public static List<DropClass> Drop_GS;

        public static List<DropClass> BossDrop;

        public static List<OpenClass> Open;

        public static List<MoveClass> Mover;

        public static List<坐标Class> 移动;

        public static List<转职属性类> 转职属性;

        public static List<int> lockLevel;

        public static Dictionary<int, 安全区Class> 安全区 = new Dictionary<int, 安全区Class>();

        public static List<坐标Class> 对练区 = new List<坐标Class>();
        public static List<坐标Class> 复仇区 = new List<坐标Class>();
        #region 仙魔大战参数
        public static Dictionary<string, string> 势力战掉线玩家 = new Dictionary<string, string>();
        public static Dictionary<int, List<string>> 势力战玩家列表 = new Dictionary<int, List<string>>();
        #endregion

        public static Dictionary<int, bbg物品类> 百宝阁物品 = new Dictionary<int, bbg物品类>();

        public static Dictionary<int, 套装物品类> 套装物品 = new Dictionary<int, 套装物品类>();

        public static Dictionary<int, 会员装备类> 会员物品 = new Dictionary<int, 会员装备类>();

        public static Dictionary<int, 套装物品类> 冲级奖励物品 = new Dictionary<int, 套装物品类>();

        public static Dictionary<int, 任务系统> 任务公告list = new Dictionary<int, 任务系统>();

        public static Dictionary<int, 任务需要物品> 任务需要物品list = new Dictionary<int, 任务需要物品>();

        public static Dictionary<string, 账号人物名> 账号人物名list = new Dictionary<string, 账号人物名>();

        public static Dictionary<int, BOSS地图> BOSS设置list = new Dictionary<int, BOSS地图>();

        public static int 单个物品大小 = 36;

        public static object locklist2 = new object();

        public static object lockLogin = new object();

        public static List<object> locklist3 = new List<object>();

        public static List<object> lockDrop = new List<object>();

        public static int 游戏登陆端口最大连接数 = 20;

        public static int 游戏登陆端口最大连接时间数 = 1000;

        public static int 查非法物品 = 0;

        public static int 查非法物品操作 = 3;

        public static bool 查绑定非法物品 = false;

        public static int 物品最高攻击值 = 61;

        public static int 寄售时间秒 = 0;

        public static int 物品最高防御值 = 49;

        public static int 物品最高武功值 = 51;

        public static int 物品最高武防值 = 80;

        public static int 物品记录 = 0;

        public static int 登陆记录 = 0;

        public static int PK记录 = 1;

        public static int 记录保存天数 = 10;

        public static bool 封IP = true;

        public static List<IPAddress> BipList = new List<IPAddress>();

        public static int 自动连接时间 = 10;

        public static int 版本验证时间 = 10000;

        public static bool 主Socket = false;

        public static string SocketState = "Stoped";

        public static bool 自动开启换端口 = true;

        public static int 允许最大连接数 = 200;

        public static bool 断开连接 = true;

        public static bool 加入过滤列表 = true;

        public static bool 关闭连接 = true;

        public static int 世界时间 = 0;

        public static int 已提现;

        public static int 已邀请;

        public static EventClass eve;

        public static int 组队获得经验限制 = 700;

        public static int W组队Id = 1;

        public static int tf = 0;

        public static int jlMsg = 0;

        public static int 允许交易等级 = 8;

        public static int 允许交易披风 = 1;
        public static int 是否允许开店 = 1;

        public static double 寄售获得元宝比例 = 0.9;

        public static int 寄售系统是否开启 = 1;

        public static int 是否可以寄售绑定装备 = 0;

        public static int 是否限制加速器 = 1;

        public static int 门派正邪加人 = 1;

        public static int 是否校验机器码 = 2;

        public static int 限制加速器时间 = 8000;

        public static int 加速检查次数 = 3;

        public static int 外挂锁人时间 = 20;

        public static int 外挂检测操作 = 0;

        public static int 窗口名检测模式 = 0;

        public static int 攻击加速检查次数 = 20;

        public static int 连续攻击有效时间 = 200;

        public static int 限制技能优化 = 1;

        public static int 武功连击有效时间 = 2500;

        public static int 武功连击冷却时间 = 8000;

        public static bool 封杀打坐杀怪 = true;

        public static bool 封杀无限打坐卡技能 = true;

        public static float[] 移动加速检查速度 = new float[10];

        public static int 移动加速检查次数 = 10;

        public static int 移动加速检查周期 = 2;


        public static string 老公提示内容;
        public static string 老婆提示内容;
        public static int 结婚物品ID;
        //public static int 元宝商店购买间隔;
        public static string 夫妻经验爆率增加;

        public static int 客户端多开;

        //public static string 宣战区地图坐标;



        public static 帮派战_门战 门战;

        public static int 门战是否开启 = 1;

        public static int 门战开启小时1 = 20;

        public static int 门战限制等级 = 35;

        public static int 门战需要金币 = 100000000;

        public static int 门战地图 = 3001;
        public static string 门站BOSS = "";

        public static int 门战进程 = 0;

        public static int 获胜门派获得武勋 = 0;

        public static int 失败门派获得武勋 = 0;

        public static string 门站随机奖励物品 = "";

        public static 伏魔洞副本 副本;

        public static int 副本开始时间 = 10;

        public static int 副本结束时间 = 22;

        public static int 副本开启状态 = 1;

        public static DateTime 提现时间间隔 = DateTime.Now;

        public static DateTime 邀请时间间隔 = DateTime.Now;

        public static DateTime 人物数据时间间隔 = DateTime.Now;

        public static int 副本进程 = 0;

        public static int 副本限制次数 = 3;

        public static int 势力战进程 = 0;

        public static int 几转势力战 = 0;

        public static int 势力战时间 = 0;

        public static int 势力战要求转职状态 = 3;

        public static int 势力战正分数 = 0;

        public static int 势力战邪分数 = 0;

        public static int 势力战第一滴血 = 0;

        public static int 组队范围 = 250;
        public static int 隔体传功是否开启 = 0;

        public static int 势力战是否开启 = 0;

        public static int 势力战时长 = 0;

        public static int 三转势力战开启小时 = 0;

        public static int 四转势力战开启小时 = 0;

        public static int 势力战开启分 = 0;

        public static int 势力战开启秒 = 0;

        public static int 势力战奖励类型 = 0;

        public static int 势力战奖励物品最大人数 = 1;



        public static string 势力战奖励个人物品 = "";

        public static int 势力战限制进入时间 = 900;

        public static int[] 势力战奖励 = new int[10];

        public static int[] 势力战失败奖励 = new int[10];

        public static int 势力战参战等级 = 35;

        public static int 势力战随机奖励物品 = 9000165;

        public static int 势力战前五名奖励武勋 = 0;

        public static int 势力战五到十名奖励武勋 = 0;

        public static int 势力战十到二十名奖励武勋 = 0;

        public static int 势力战二十到五十名奖励武勋 = 0;

        public static int 势力战基础奖励武勋 = 0;

        public static int[] 挂机奖励 = new int[10];

        public static List<int> 挂机奖励地图;

        public static int 复制物品是否封号 = 1;

        public static int 复制物品检查时间 = 20;

        public static int 挂机奖励时间周期 = 30;

        public static int 离线挂机是否开启 = 1;

        public static double 离线挂机等级限制 = 100.0;

        public static int 新人保护等级 = 35;

        public static int 创建门派需要等级 = 60;

        public static string 创建门派所需物品ID = "";

        public static double 气功百分比 = 1.0;

        public static int 最大气功数 = 0;

        public static int 最大钱数 = 2000000000;

        public static int 最大元宝数 = 1000000000;

        public static int 强化公告等级 = 9;

        public static int 元宝合成 = 5;

        public static int 装备加解锁开关 = 1;

        public static int 加锁元宝数 = 0;

        public static int 加锁金币数 = 10000000;

        public static int 解锁元宝数 = 0;

        public static int 解锁金币数 = 10000000;

        public static int 再造系统是否开启 = 1;

        public static int 每次消耗的数量 = 500000;

        public static double 发送速度 = 0.0;

        public static double 广播发送速度 = 0.0;

        public static double 接收速度 = 0.0;

        public static double 经验倍数 = 10.0;

        public static int 人怪等级差最小限制 = 10;

        public static double 钱倍数 = 1.0;

        public static double 历练倍数 = 1.0;

        public static int 暴率 = 800;

        public static double 合成率 = 0.0;

        public static string 强化几率控制;

        public static string 合成几率控制;
        public static string 属性几率控制;

        public static string 百宝阁地址 = "http://bbg.7xjh.com:88/login.aspx?server=1";

        public static string 百宝阁服务器IP = "127.0.0.1";

        public static int 百宝阁服务器端口 = 9001;

        public static int 高倍经验开启时间 = 13;

        public static int 高倍经验结束时间 = 17;

        public static double 高倍经验倍数 = 1.5;

        public static double 南明湖经验倍数 = 1.5;

        public static double 北海经验倍数 = 1.5;
        public static double 队伍单职业经验加成百分比 = 1.5;

        public static int 是否开启高倍经验 = 0;

        public static double 三十五级以下经验倍数 = 2.0;

        public static double 六十级以下经验倍数 = 3.0;

        public static double 八十级以下经验倍数 = 3.0;

        public static double 九十级以下经验倍数 = 3.0;

        public static double 百级以下经验倍数 = 1.5;

        public static string 帐号验证服务器IP = "127.0.0.1";

        public static int 帐号验证服务器端口 = 55970;

        public static int 游戏服务器端口 = 13001;

        public static int 游戏服务器端口2 = 13001;

        public static int 游戏服务器端口1 = 13001;

        public static int 转发器网关服务端口 = 50020;

        public static int vip线 = 0;

        public static int 安全区开关 = 1;

        public static int 封包异步发送 = 0;

        public static int 最大在线 = 100;

        public static int 服务器组ID = 1;

        public static int 服务器ID = 0;

        public static string 服务器名 = "江湖";

        public static string 进入公告 = "欢迎光临!help查看自定义命令";

        public static int Gamedayov = 0;

        public static string 进入传书 = "欢迎光临!help查看自定义命令";

        public static string 门派公告 = "江湖|长久稳定";

        public static BdAtapiDevice KeykF = new BdAtapiDevice();

        public static int Log;

        public static int 验证服务器log;

        public static int jllog;

        public static int 狮子吼ID = 0;

        public static Queue 狮子吼List = Queue.Synchronized(new Queue());

        public static int 狮子吼最大数 = 0;

        public static ScriptClass 脚本;

        public static int 是否加密 = 1;
        public static int 登陆器模式;

        public static int PK开关 = 0;

        public static int VIP线路端口 = 7188;

        public static int 购买间隔 = 500;

        public static int 交易完成间隔 = 500;
        public static int 交易放物品间隔 = 500;
        public static Connect conn;

        public static string 冲关地图 = "";

        public static string SqlJl = "";

        public static int 装备最大数 = 36;

        public static int 自动存档 = 1;

        public static List<int> 锁定物品列表 = new List<int>();

        public static List<long> 查复制物品列表 = new List<long>();

        public static string 地图锁定;

        public static string 金符地图;

        public static List<int> 限制PK地图列表 = new List<int>();

        public static List<int> 限时PK地图列表 = new List<int>();

        public static int 限时地图开PK时间 = 19;

        public static int 限时地图关PK时间 = 23;

        public static int 限时地图是否开启 = 0;

        public static int PK等级差 = 15;

        public static double 剑客回柳身法 = 0.001;

        public static double 枪客乾坤挪移 = 0.01;

        public static double 枪客灵甲护身 = 0.0075;

        public static double 灵甲护身加成 = 1.25;

        public static double 枪客末日狂舞 = 0.002;

        public static double 弓手攻击倍数 = 1.8;

        public static double 医生长工系数 = 2.2;

        public static double 武功攻击倍数 = 2.0;

        public static string[] dt;

        public static string[] fc;
        public static string[] 获得物品等级差;
        public static int 是否开启仓库时间限制 = 10;

        public static int 仓库操作间隔 = 500;
        public static string[] 综合仓库80级;
        public static int 综合仓库80级以下;

        public static int 换线收取类型;

        public static int 换线元宝数量;
        public static int 换线金币数量 ;

        public static int 伏魔洞收取类型;

        public static int 伏魔洞元宝数量;
        public static int 伏魔洞金币数量;

        public static string[] 杀人武勋限制;

        public static int 人物最高等级 = 255;

        public static double 武功防御力控制 = 600.0;

        public static double 武功攻击力控制 = 100.0;

        public static int 组队级别限制 = 10;

        public static int 武勋保护药品 = 1000000024;

        public static int 武勋解保护药品 = 1000000051;

        public static int 死亡保护药品 = 1000000052;

        public static int 死亡保护时间 = 8;

        public static int 扔物品操作 = 1;

        public static int 医生弓手攻击距离 = 100;

        public static int 刀枪剑攻击距离 = 50;

        public static int 是否开启查看装备功能 = 1;

        public static int 是否开启师徒系统 = 0;

        public static int 徒弟最高等级限制 = 80;

        public static int 是否开启死亡掉经验 = 1;

        public static int 死亡复活锁定时间 = 0;

        public static int 死亡掉经验开始等级 = 35;

        public static int 死亡掉经验比例 = 10000;

        public static int 是否上线发送礼品 = 0;

        public static int 新老玩家回归奖励 = 0;

        public static int 老玩家回归等级限制 = 59;

        public static int 上线礼品标识码 = 1;

        public static int 狮吼功需要元宝 = 10;

        public static int 狮吼功需要游戏币 = 10;

        public static int 狮吼功元宝金币切换开关;

        public static int 是否开启气功提示 = 0;

        public static int 积分兑换武勋数量 = 70000;

        public static int 武勋丹需要积分数量 = 150;

        public static int 兑换五色需要积分数量 = 80;

        public static int 是否开启土豪系统 = 0;

        public static int 全服土豪需要元宝 = 500;

        public static int 全服土豪需要积分 = 6000;

        public static int 队伍土豪需要金币 = 100000000;

        public static int 队伍土豪需要积分 = 1200;

        public static int 队伍土豪需要元宝 = 120;

        public static int 追杀系统需要元宝 = 50;

        public static int 存储过程优化 = 1;

        public static int 是否开启跨线传音 = 1;

        public static int 是否开启共用银币市场 = 1;

        public static int 禁止出售物品1 = 35;

        public static int 禁止出售物品2 = 35;

        public static int 禁止出售物品3 = 35;

        public static int 禁止出售物品4 = 35;

        public static int 禁止出售物品5 = 35;

        public static double 刀客暴率百分比;
        public static double 刀打怪攻击百分比;
        public static double 剑打怪攻击百分比;
        public static double 枪打怪攻击百分比;
        public static double 弓打怪攻击百分比;
        public static double 医打怪攻击百分比;

        public static int 是否开启实时坐标显示;
        public static int 实时检测距离;
        public static double 限制打坐距离 = 60.0;
        public static float 普通走 = 3.15f;
        public static float 轻功一 = 4.15f;
        public static float 轻功二 = 5.15f;
        public static float 轻功三 = 6.15f;
        public static int 实时移动时间 = 100;

        public static float 宠物普通走 = 3.15f;
        public static float 宠物轻功一 = 3.15f;
        public static float 宠物轻功二 = 3.15f;
        public static float 宠物轻功三 = 3.15f;

        public static int 元宝商店开关 = 1;//元宝商店设置

        public static int 当前线路类型 = 0;
        public static int 退出时间间隔 = 0;//无效

        public static int 换线存档方式 = 1;

        public static int 换线移动间隔 = 5;

        public static string 银币服务器IP = "127.0.0.1";

        public static string 银币服务器IP2 = "127.0.0.1";

        public static string 银币服务器PORT = "0";

        public static string 主服务器PORT = "0";

        public static float 怪物移动最大范围 = 400f;

        public static int 打坐获取坐标方式 = 0;

        public static bool 记录掉落 = true;

        public static bool 记录再造 = false;

        public static int 银币移动测试封包 = 0;

        public static int 限制远程打开NPC = 1;

        public static int 打开NPC限制距离 = 300;

        public static int 武勋丹使用上限 = 1000000;

        public static int 是否限制无限躺尸 = 0;

        public static int 是否封杀锁人功能 = 1;

        public static int 周末全天PK是否开启 = 0;

        public static List<int> 周末全天PK地图列表 = new List<int>();

        public static int 工作日限时地图开PK时间 = 5;

        public static int 工作日限时地图关PK时间 = 23;

        public static int 工作日限时地图是否开启 = 1;

        public static int 限制连环飞舞确认时间 = 50;

        public static int 连续快速攻击次数 = 10;

        public static int 非法攻击外挂操作 = 0;

        public static int 全局测试模式 = 1;

        public static int BOSS权限需要积分 = 1500;

        public static int BOSS初始化次数 = 0;

        public static int BOSS金符持有初始化次数 = 1;

        public static int 是否开启BOSS挑战 = 0;

        public static List<ServerClass> ServerList = new List<ServerClass>();

        public static Players 检查玩家(string Userid)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                if (current.Userid == Userid)
                {
                    return current;
                }
            }
            return null;
        }

        public static Players 检查玩家世界ID(int ID)
        {
            Players result;
            if (World.allConnectedChars.TryGetValue(ID, out result))
            {
                return result;
            }
            return null;
        }

        public static Players 检查玩家name(string Username)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                if (current.UserName == Username)
                {
                    return current;
                }
            }
            return null;
        }

        public static void 发送公告(string msg)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                current.系统公告(msg);
            }
        }

        public static void 系统滚动公告(string msg)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                current.系统滚动公告(msg);
            }
        }

        public static void 系统全局提示(string msg, string txt)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                current.系统提示(txt, 10, msg);
            }
        }

        public static void 系统全局提示(string msg, string txt, int type)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                current.系统提示(txt, type, msg);
            }
        }

        public static void 装逼全局提示(string msg, string txt, int type)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                current.装逼提示(txt, type, msg);
            }
        }

        public static void 全局提示(string msg, int type, string txt)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                current.系统提示(txt, type, msg);
            }
        }

        public static void Process狮子吼Queue()
        {
            if (World.狮子吼List.Count > 0)
            {
                if (World.jlMsg == 1)
                {
                    Form1.WriteLine(0, "Process狮子吼Queue()");
                }
                狮子吼Class 狮子吼Class = (狮子吼Class)World.狮子吼List.Dequeue();
                World.发送狮子吼消息广播数据(狮子吼Class.FLD_INDEX, 狮子吼Class.UserName, 狮子吼Class.TxtId, 狮子吼Class.Txt);
            }
        }

        public static void 发送狮子吼消息广播数据(int 人物全服ID, string name, int msgid, string msg)
        {
            try
            {
                string hex = "AA55A6000000006600970000C8CEBDDC0000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055AA";
                byte[] array = Converter.hexStringToByte(hex);
                array[11] = 14;
                byte[] bytes = Encoding.Default.GetBytes(name);
                byte[] bytes2 = Encoding.Default.GetBytes(msg);
                Buffer.BlockCopy(bytes2, 0, array, 34, bytes2.Length);
                Buffer.BlockCopy(bytes, 0, array, 12, bytes.Length);
                Buffer.BlockCopy(BitConverter.GetBytes(人物全服ID), 0, array, 5, 2);
                array[33] = (byte)msgid;
                foreach (Players current in World.allConnectedChars.Values)
                {
                    if (current.Client != null)
                    {
                        current.Client.Send(array, array.Length);
                    }
                }
            }
            catch (Exception ex)
            {
                Form1.WriteLine(1, string.Concat(new object[]
                {
                    "World发送狮子吼消息广播数据出错![",
                    人物全服ID,
                    "]-[",
                    name,
                    "]-[",
                    msg,
                    "]",
                    ex.Message
                }));
            }
        }

        public static void 发送全服狮子吼消息广播数据(int 人物全服ID, string name, int msgid, string msg, int 线, int map)
        {
            try
            {
                string hex = "AA55A6000000006600970000C8CEBDDC0000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055AA";
                byte[] array = Converter.hexStringToByte(hex);
                array[11] = 14;
                byte[] bytes = Encoding.Default.GetBytes(name + " " + 线.ToString() + "线");
                byte[] bytes2 = Encoding.Default.GetBytes(msg);
                Buffer.BlockCopy(bytes2, 0, array, 34, bytes2.Length);
                Buffer.BlockCopy(bytes, 0, array, 12, bytes.Length);
                Buffer.BlockCopy(BitConverter.GetBytes(人物全服ID), 0, array, 5, 2);
                array[33] = (byte)msgid;
                foreach (Players current in World.allConnectedChars.Values)
                {
                    if (current.Client != null)
                    {
                        current.Client.Send(array, array.Length);
                    }
                }
            }
            catch (Exception ex)
            {
                Form1.WriteLine(1, string.Concat(new object[]
                {
                    "World发送狮子吼消息广播数据出错![",
                    人物全服ID,
                    "]-[",
                    name,
                    "]-[",
                    msg,
                    "]",
                    ex.Message
                }));
            }
        }

        public static void 发送帮派消息(string username, string msg, string bpname, int ServerID)
        {
            if (ServerID != World.服务器ID)
            {
                string.Concat(new object[]
                {
                    "[",
                    ServerID,
                    "线]",
                    username
                });
            }
            string hex = "AA55A6000000006600970000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055AA";
            byte[] array = Converter.hexStringToByte(hex);
            array[11] = 3;
            byte[] bytes = Encoding.Default.GetBytes(username);
            byte[] bytes2 = Encoding.Default.GetBytes(msg);
            Buffer.BlockCopy(bytes2, 0, array, 34, bytes2.Length);
            Buffer.BlockCopy(bytes, 0, array, 12, bytes.Length);
            Buffer.BlockCopy(BitConverter.GetBytes(300), 0, array, 5, 2);
            try
            {
                foreach (Players current in World.allConnectedChars.Values)
                {
                    if (current.帮派名字 == bpname && current.Client != null)
                    {
                        current.Client.Send(array, array.Length);
                    }
                }
            }
            catch
            {
            }
        }

        public static void 发送传音消息(int Wid, string FromName, string ToName, string msg)
        {
            try
            {
                Players players = World.检查玩家name(ToName);
                if (players != null)
                {
                    if (players.Config.传音 == 0)
                    {
                        World.conn.发送(string.Concat(new object[]
                        {
                            "传音失败|对方设置不容许传音|",
                            Wid,
                            "|",
                            FromName
                        }));
                    }
                    else
                    {
                        World.conn.发送(string.Concat(new string[]
                        {
                            "传音返回|",
                            FromName,
                            "|",
                            ToName,
                            "|",
                            msg
                        }));
                        string hex = "AA55A6000000006600970000C8CEBDDC0000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055AA";
                        byte[] array = Converter.hexStringToByte(hex);
                        array[11] = 4;
                        byte[] bytes = Encoding.Default.GetBytes(FromName);
                        byte[] bytes2 = Encoding.Default.GetBytes(msg);
                        Buffer.BlockCopy(bytes2, 0, array, 34, bytes2.Length);
                        Buffer.BlockCopy(bytes, 0, array, 12, bytes.Length);
                        if (Wid == players.人物全服ID)
                        {
                            Wid++;
                        }
                        Buffer.BlockCopy(BitConverter.GetBytes(Wid), 0, array, 5, 2);
                        if (players.Client != null)
                        {
                            players.Client.Send(array, array.Length);
                        }
                    }
                }
            }
            catch
            {
            }
        }

        public static void 发送传音返回消息(string FromName, string ToName, string msg)
        {
            try
            {
                Players players = World.检查玩家name(FromName);
                if (players != null)
                {
                    string hex = "AA55A6000000006600970000C8CEBDDC0000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055AA";
                    byte[] array = Converter.hexStringToByte(hex);
                    array[11] = 4;
                    byte[] bytes = Encoding.Default.GetBytes(ToName);
                    byte[] bytes2 = Encoding.Default.GetBytes(msg);
                    Buffer.BlockCopy(bytes2, 0, array, 34, bytes2.Length);
                    Buffer.BlockCopy(bytes, 0, array, 12, bytes.Length);
                    Buffer.BlockCopy(BitConverter.GetBytes(players.人物全服ID), 0, array, 5, 2);
                    if (players.Client != null)
                    {
                        players.Client.Send(array, array.Length);
                    }
                }
            }
            catch
            {
            }
        }

        public static void 发送传音失败消息(string FromName, string msg)
        {
            try
            {
                Players players = World.检查玩家name(FromName);
                if (players != null)
                {
                    players.系统提示(msg, 9, "系统提示");
                }
            }
            catch
            {
            }
        }

        public static int Add组队(组队Class 队)
        {
            int result = 1;
            for (int i = 1; i < 100000000; i++)
            {
                组队Class 组队Class;
                if (!World.W组队.TryGetValue(i, out 组队Class))
                {
                    World.W组队.Add(i, 队);
                    result = i;
                    break;
                }
            }
            return result;
        }

        static World()
        {
            try
            {
                World.石头属性调整 = new Dictionary<int, 石头属性调整类>();
                World.eve90Players = new ThreadSafeDictionary<int, Players>();
                World.eve80Players = new ThreadSafeDictionary<int, Players>();
                World.转职属性 = new List<转职属性类>();
                World.Kill = new List<KillClass>();
                World.W组队 = new Dictionary<int, 组队Class>();
                World.公告 = new Dictionary<int, 公告类>();
                World.lever = new Dictionary<int, double>();
                World.Patlever = new Dictionary<int, double>();
                World.lockLevel = new List<int>();
                World.Wxlever = new Dictionary<int, 武勋加成类>();
                World.Itme = new Dictionary<int, ItmeClass>();
                World.ItmeTeM = new ThreadSafeDictionary<long, 地面物品类>();
                World.TBL_KONGFU = new Dictionary<int, 武功类>();
                World.MonSter = new Dictionary<int, MonSterClss>();
                World.物品检查 = new List<检查物品类>();
                World.BossDrop = new List<DropClass>();
                World.Drop = new List<DropClass>();
                World.Drop_GS = new List<DropClass>();
                World.Open = new List<OpenClass>();
                World.Shot = new List<ShotClass>();
                World.Mover = new List<MoveClass>();
                World.移动 = new List<坐标Class>();
                World.对练区 = new List<坐标Class>();
                World.复仇区 = new List<坐标Class>();
                World.BOSS设置list = new Dictionary<int, BOSS地图>();
                World.挂机奖励地图 = new List<int>();
                World.Keyk.CpuID = Hasher.GetCpuID();
                World.Keyk.DriveID = Hasher.GetDriveID("C");
                World.Keyk.IP = Hasher.GetIP();
                World.Keyk.Mac = Hasher.GetMac();
            }
            catch (Exception arg)
            {
                Form1.WriteLine(100, "系统错误:World" + arg);
            }
        }

        public static void 更新副本次数()
        {
            try
            {
                RxjhClass.初始化副本次数();
                foreach (Players current in World.allConnectedChars.Values)
                {
                    current.副本次数 = 0;
                }
            }
            catch (Exception)
            {
            }
        }

        public static void 发送地图PK公告(int msg)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                foreach (int current2 in World.限时PK地图列表)
                {
                    if (current.人物坐标_地图 == current2)
                    {
                        if (msg == 1)
                        {
                            current.系统公告("本地图现在开始开放PK");
                        }
                        else
                        {
                            current.系统公告("本地图现在开始禁止PK");
                        }
                    }
                }
            }
        }
        private static int GetWeekName()
        {
            int result = 0;
            switch (DateTime.Now.DayOfWeek)
            {
                case DayOfWeek.Sunday:
                    result = 7;
                    break;
                case DayOfWeek.Monday:
                    result = 1;
                    break;
                case DayOfWeek.Tuesday:
                    result = 2;
                    break;
                case DayOfWeek.Wednesday:
                    result = 3;
                    break;
                case DayOfWeek.Thursday:
                    result = 4;
                    break;
                case DayOfWeek.Friday:
                    result = 5;
                    break;
                case DayOfWeek.Saturday:
                    result = 6;
                    break;
            }
            return result;
        }
        public static void 发送地图PK公告2(int msg)
        {
            foreach (Players current in World.allConnectedChars.Values)
            {
                foreach (int current2 in World.限时PK地图列表)
                {
                    if (current.人物坐标_地图 == current2)
                    {
                        if (msg == 1)
                        {
                            current.系统公告("本地图现在开始开放PK");
                        }
                        else
                        {
                            current.系统公告("时间太晚了,为了广大玩家身心健康,本地图现在开始禁止PK");
                        }
                    }
                }
            }
        }

      

        private void 世界时间事件()
        {
            if (World.jlMsg == 1)
            {
                Form1.WriteLine(0, "世界时间事件()");
            }

            if (世界时间事件累计秒 < 3)//核查的时间
            {
                世界时间事件累计秒 = 世界时间事件累计秒 + 1;
                Form1.WriteLine(2, "假人线程自检|" + 世界时间事件累计秒);
            }
            //提现公告************************
            if ((int)DateTime.Now.Subtract(提现时间间隔).TotalMilliseconds >= 1500)
            {
                get提现公告();
                提现时间间隔 = DateTime.Now;
            }

            if ((int)DateTime.Now.Subtract(邀请时间间隔).TotalMilliseconds >= 1500)
            {
                get邀请公告();
                邀请时间间隔 = DateTime.Now;
            }
            if ((int)DateTime.Now.Subtract(人物数据时间间隔).TotalMilliseconds >= 1000000)
            {
                Set人物数据();
                人物数据时间间隔 = DateTime.Now;
            }

            int 时间间隔 = (int)DateTime.Now.Subtract(离线挂机时间间隔).TotalMilliseconds;
            if (时间间隔 >= 1500)
            { foreach (Players value24 in allConnectedChars.Values)
                {if (value24.换线过程时间秒 >= 1)
                    {
                        value24.换线过程时间秒 = value24.换线过程时间秒 + 1;

                        if (value24.换线过程时间秒 >= 4)
                        {
                            value24.移动(value24.换线X, value24.换线Y, 15, value24.换线MAP);//复原
                            value24.移动(value24.换线X, value24.换线Y, 51, value24.换线MAP);//复原
                            value24.换线过程时间秒 = 0;
                        }

                         
                    }

                    if (value24.离线挂机打怪模式 == 1)
                    {
                        value24.自动打怪();
                    }
                }
                离线挂机时间间隔 = DateTime.Now;
            }



            World.世界时间 = DateTime.Now.Hour * 3600 + DateTime.Now.Minute * 60 + DateTime.Now.Second;
            if (World.是否开启BOSS挑战 == 1)
            {
                if (DateTime.Now.Minute == 0 && DateTime.Now.Second == 0)
                {
                    if (DateTime.Now.Hour == 0)
                    {
                        BOSS地图.更新BOSS次数();
                    }
                    BOSS地图.chaeckBossInfo(DateTime.Now.Hour);
                }
                else if (DateTime.Now.Minute == 10 && DateTime.Now.Second == 0)
                {
                    BOSS地图.resetBossInfo();
                }
            }
            if (World.当前线路类型 == 0)
            {
                if (World.副本开始时间 != World.副本结束时间)
                {
                    if (DateTime.Now.Hour == World.副本开始时间 && DateTime.Now.Minute == 0 && DateTime.Now.Second >= 0 && World.副本开启状态 == 0)
                    {
                        World.副本开启状态 = 1;
                        World.更新副本次数();
                        World.发送公告("4转伏魔洞副本开启,勇士们战斗吧！可获得大量经验和物品");
                    }
                    else if (DateTime.Now.Hour == World.副本结束时间 && DateTime.Now.Minute == 0 && DateTime.Now.Second >= 0 && World.副本开启状态 == 1)
                    {
                        World.副本开启状态 = 0;
                        World.发送公告("伏魔洞副本结束！");
                    }
                }
                if (DateTime.Now.Hour == World.限时地图开PK时间)
                {
                    if (World.限时地图是否开启 == 0)
                    {
                        World.限时地图是否开启 = 1;
                        World.发送地图PK公告(1);
                    }
                }
                else if (DateTime.Now.Hour == World.限时地图关PK时间 && World.限时地图是否开启 == 1)
                {
                    World.限时地图是否开启 = 0;
                    World.发送地图PK公告(0);
                }
                int num = Convert.ToInt32(DateTime.Today.DayOfWeek);
                if (num < 5 && World.周末全天PK是否开启 == 1)
                {
                    if (DateTime.Now.Hour == World.工作日限时地图开PK时间)
                    {
                        if (World.工作日限时地图是否开启 == 0)
                        {
                            World.工作日限时地图是否开启 = 1;
                            World.发送地图PK公告2(1);
                        }
                    }
                    else if (DateTime.Now.Hour == World.工作日限时地图关PK时间 && World.工作日限时地图是否开启 == 1)
                    {
                        World.工作日限时地图是否开启 = 0;
                        World.发送地图PK公告2(0);
                    }
                }
                if (World.高倍经验倍数 > 1.0)
                {
                    if (DateTime.Now.Hour == World.高倍经验开启时间)
                    {
                        if (World.是否开启高倍经验 == 0)
                        {
                            World.是否开启高倍经验 = 1;
                            World.发送公告(World.高倍经验倍数 + "倍经验开启！");
                            return;
                        }
                    }
                    else if (DateTime.Now.Hour == World.高倍经验结束时间 && World.是否开启高倍经验 == 1)
                    {
                        World.是否开启高倍经验 = 0;
                        World.发送公告(World.高倍经验倍数 + "倍经验结束！");
                        return;
                    }
                }
            }
         if(World.开启本线路势力战==1)
            {
                World.限时地图是否开启 = 1;
                World.工作日限时地图是否开启 = 1;
                if (World.势力战是否开启 == 1)
                {
                    int weekName = World.GetWeekName();
                    if (DateTime.Now.Hour == World.三转势力战开启小时 && DateTime.Now.Minute == World.势力战开启分)
                    {
                        if (World.eve == null)
                        {
                            Form1.WriteLine(1, "[二转][三转]势力战线程启动");
                            World.势力战进程 = 0;
                            World.势力战时间 = 0;
                            World.势力战正分数 = 0;
                            World.势力战邪分数 = 0;
                            World.eve = new EventClass(3);
             
                        }
                    }
                    else if (DateTime.Now.Hour == World.四转势力战开启小时 && DateTime.Now.Minute == World.势力战开启分)
                    {
                        if (World.eve == null)
                        {
                            Form1.WriteLine(1, "[四转]势力战线程启动");
                            World.势力战进程 = 0;
                            World.势力战时间 = 0;
                            World.势力战正分数 = 0;
                            World.势力战邪分数 = 0;
                            World.eve = new EventClass(4);
                        }
                    }

                    //if ((weekName == 1 || weekName == 2 || weekName == 3 || weekName == 4 || weekName == 5 || weekName == 6 || weekName == 7) && World.势力战是否开启 == 1)
                    //{
                    //    if (DateTime.Now.Hour == 20 && DateTime.Now.Minute == 00 && (DateTime.Now.Second == 0 || DateTime.Now.Second == 1 || DateTime.Now.Second == 2) && World.eve == null)
                    //    {
                    //        World.eve = new EventClass();
                    //        World.势力战进程 = 0;
                    //        World.势力战时间 = 0;
                    //        World.势力战正分数 = 0;
                    //        World.势力战邪分数 = 0;
                    //        //World.势力战正人数 = 0;
                    //        //World.势力战邪人数 = 0;
                    //        //World.胜利帮派ID = 0;
                    //        DBA.ExeSqlCommand("DELETE FROM EventTop");
                    //    }
                    //    if (DateTime.Now.Hour == 21 && DateTime.Now.Minute == 00 && (DateTime.Now.Second == 0 || DateTime.Now.Second == 1 || DateTime.Now.Second == 2) && World.eve == null)
                    //    {
                    //        World.eve = new EventClass();
                    //        World.势力战进程 = 0;
                    //        World.势力战时间 = 0;
                    //        World.势力战正分数 = 0;
                    //        World.势力战邪分数 = 0;
                    //        //World.势力战正人数 = 0;
                    //        //World.势力战邪人数 = 0;
                    //        //World.胜利帮派ID = 0;
                    //        return;
                    //    }
                    //}
                }
                if (World.门战是否开启 == 1 && DateTime.Now.Hour == World.门战开启小时1 && DateTime.Now.Minute == 11 && DateTime.Now.Second >= 0)
                {
                    //if (World.门战 != null)
                    //{
                    //	World.门战.Dispose();
                    //	World.门战 = null;
                    //}
                    if (World.门战 == null)
                    {
                        World.门战 = new 帮派战_门战();
                    }
                }
            }
        }

        public static void 端口更换通知()
        {
            foreach (WGHandler wGHandler in WGServer.clients)
            {
                wGHandler.Sendd(string.Concat(new object[]
                {
                    "更新服务器端口|",
                    World.服务器ID,
                    "|",
                    World.游戏服务器端口1.ToString()
                }));
            }
        }

        public static void 端口更换通知(string serverid)
        {
            foreach (WGHandler wGHandler in WGServer.clients)
            {
                if (wGHandler.ServerId == serverid)
                {
                    wGHandler.Sendd("更新服务器端口|" + World.游戏服务器端口1.ToString());
                }
            }
        }

    
     

            public World()
        {
            RxjhServer.Timer.DelayCall(TimeSpan.FromMilliseconds(1000.0), TimeSpan.FromMilliseconds(1000.0), new TimerCallback(this.世界时间事件));
        }

        public void SetScript()
        {
            World.脚本 = new ScriptClass();
        }

        public void SetConfig()
        {
            try
            {
                Config.Path = Application.StartupPath + "\\config.ini";
                World.Key = Config.IniReadValue("GameServer", "Key").Trim();
                World.Key2 = Config.IniReadValue("GameServer", "Key2").Trim();
                World.进入公告 = Config.IniReadValue("GameServer", "进入公告").Trim();
                World.进入传书 = Config.IniReadValue("GameServer", "进入传书").Trim();
                World.百宝阁地址 = Config.IniReadValue("GameServer", "百宝阁地址").Trim();
                World.服务器名 = Config.IniReadValue("GameServer", "服务器名").Trim();
                World.冲关地图 = Config.IniReadValue("GameServer", "冲关地图").Trim();
                World.门派公告 = ((Config.IniReadValue("GameServer", "门派公告").Trim() == "") ? World.门派公告 : Config.IniReadValue("GameServer", "门派公告").Trim());
                World.当前线路类型 = ((Config.IniReadValue("GameServer", "当前线路类型").Trim() == "") ? World.当前线路类型 : int.Parse(Config.IniReadValue("GameServer", "当前线路类型").Trim()));
                退出时间间隔 = ((Config.IniReadValue("GameServer", "退出时间间隔").Trim() == "") ? World.退出时间间隔 : int.Parse(Config.IniReadValue("GameServer", "退出时间间隔").Trim()));
                //if ( World.当前线路类型 == 0)
                //{
                try
                    {
                        int num = int.Parse(Config.IniReadValue("MAINSERVER", "serverCount"));
                        World.ServerList.Clear();
                        for (int i = 0; i < num; i++)
                        {
                            ServerClass serverClass = new ServerClass();
                            string[] array = Config.IniReadValue("MAINSERVER", "server" + i).Split(new char[]
                            {
                                ','
                            });
                            serverClass.SERVER_NAME = array[0];//1线
                            serverClass.ServerId = int.Parse(array[1]);//1-10
                            serverClass.SERVER_PORT = array[2];//IP
                            serverClass.Open = int.Parse(array[3]);//端口
                        serverClass.准换线 = int.Parse(array[4]);//1-0

                        World.ServerList.Add(serverClass);
                        //Form1.WriteLine(2, "SERVER_NAME" + array[0]);
                        //Form1.WriteLine(2, "ServerId " + array[1]);
                        //Form1.WriteLine(2, "SERVER_PORT " + array[2]);
                        //Form1.WriteLine(2, "Open " + array[3]);
                        

                    }
                    }
                    catch
                    {
                    }
                //}
                老公提示内容 = Config.IniReadValue("GameServer", "老公提示内容").Trim();
                老婆提示内容 = Config.IniReadValue("GameServer", "老婆提示内容").Trim();
                夫妻经验爆率增加 = Config.IniReadValue("GameServer", "夫妻经验爆率增加").Trim();
                //宣战区地图坐标 = Config.IniReadValue("GameServer", "宣战区地图坐标").Trim();
                客户端多开 = int.Parse(Config.IniReadValue("GameServer", "客户端多开").Trim());
                dt = Config.IniReadValue("GameServer", "宣战区地图参数").Trim().Split(',');
                fc = Config.IniReadValue("GameServer", "复仇区地图参数").Trim().Split(',');
                获得物品等级差 = Config.IniReadValue("GameServer", "获得物品等级差").Trim().Split(',');

                换线收取类型 = int.Parse(Config.IniReadValue("GameServer", "换线收取类型").Trim());

                换线元宝数量 = int.Parse(Config.IniReadValue("GameServer", "换线元宝数量").Trim());
                换线金币数量 = int.Parse(Config.IniReadValue("GameServer", "换线金币数量").Trim());

                VIP线路端口 = int.Parse(Config.IniReadValue("GameServer", "VIP线路端口").Trim());

                伏魔洞收取类型 = int.Parse(Config.IniReadValue("GameServer", "伏魔洞收取类型").Trim());

                伏魔洞元宝数量 = int.Parse(Config.IniReadValue("GameServer", "伏魔洞元宝数量").Trim());
                伏魔洞金币数量 = int.Parse(Config.IniReadValue("GameServer", "伏魔洞金币数量").Trim());

                是否开启仓库时间限制 = int.Parse(Config.IniReadValue("GameServer", "是否开启仓库时间限制").Trim());
                综合仓库80级 = Config.IniReadValue("GameServer", "综合仓库80级").Trim().Split(',');
                杀人武勋限制 = Config.IniReadValue("GameServer", "杀人武勋限制").Trim().Split(',');
                综合仓库80级以下 = int.Parse(Config.IniReadValue("GameServer", "综合仓库80级以下").Trim());
                仓库操作间隔 = ((Config.IniReadValue("GameServer", "仓库操作间隔").Trim() == "") ? World.仓库操作间隔 : int.Parse(Config.IniReadValue("GameServer", "仓库操作间隔").Trim()));
                结婚物品ID = int.Parse(Config.IniReadValue("GameServer", "结婚物品ID").Trim());

                开启本线路势力战 = int.Parse(Config.IniReadValue("GameServer", "开启本线路势力战").Trim());

                二级门派升级所需金钱 = int.Parse(Config.IniReadValue("GameServer", "二级门派升级所需金钱").Trim());
                三级门派升级所需金钱 = int.Parse(Config.IniReadValue("GameServer", "三级门派升级所需金钱").Trim());
                四级门派升级所需金钱 = int.Parse(Config.IniReadValue("GameServer", "四级门派升级所需金钱").Trim());
                五级门派升级所需金钱 = int.Parse(Config.IniReadValue("GameServer", "五级门派升级所需金钱").Trim());
                六级门派升级所需金钱 = int.Parse(Config.IniReadValue("GameServer", "六级门派升级所需金钱").Trim());


                四级门派增加经验 = ((Config.IniReadValue("GameServer", "四级门派增加经验").Trim().Length == 0) ? World.四级门派增加经验 : double.Parse(Config.IniReadValue("GameServer", "四级门派增加经验").Trim()));
                四级门派增加爆率 = ((Config.IniReadValue("GameServer", "四级门派增加爆率").Trim().Length == 0) ? World.四级门派增加爆率 : double.Parse(Config.IniReadValue("GameServer", "四级门派增加爆率").Trim()));

                五级门派增加经验 = ((Config.IniReadValue("GameServer", "五级门派增加经验").Trim().Length == 0) ? World.五级门派增加经验 : double.Parse(Config.IniReadValue("GameServer", "五级门派增加经验").Trim()));
                五级门派增加爆率 = ((Config.IniReadValue("GameServer", "五级门派增加爆率").Trim().Length == 0) ? World.五级门派增加爆率 : double.Parse(Config.IniReadValue("GameServer", "五级门派增加爆率").Trim()));

                六级门派增加经验 = ((Config.IniReadValue("GameServer", "六级门派增加经验").Trim().Length == 0) ? World.六级门派增加经验 : double.Parse(Config.IniReadValue("GameServer", "六级门派增加经验").Trim()));
                六级门派增加爆率 = ((Config.IniReadValue("GameServer", "六级门派增加爆率").Trim().Length == 0) ? World.六级门派增加爆率 : double.Parse(Config.IniReadValue("GameServer", "六级门派增加爆率").Trim()));




                是否开启实时坐标显示 = int.Parse(Config.IniReadValue("GameServer", "是否开启实时坐标显示").Trim());
                实时检测距离 = int.Parse(Config.IniReadValue("GameServer", "实时检测距离").Trim());
                限制打坐距离 = int.Parse(Config.IniReadValue("GameServer", "限制打坐距离").Trim());
                轻功三 = (Config.IniReadValue("GameServer", "轻功三") == "") ? 轻功三 : float.Parse(Config.IniReadValue("GameServer", "轻功三"));
                实时移动时间 = (Config.IniReadValue("GameServer", "实时移动时间") == "") ? 实时移动时间 : int.Parse(Config.IniReadValue("GameServer", "实时移动时间"));
                普通走 = (Config.IniReadValue("GameServer", "普通走") == "") ? 普通走 : float.Parse(Config.IniReadValue("GameServer", "普通走"));
                轻功一 = (Config.IniReadValue("GameServer", "轻功一") == "") ? 轻功一 : float.Parse(Config.IniReadValue("GameServer", "轻功一"));
                轻功二 = (Config.IniReadValue("GameServer", "轻功二") == "") ? 轻功二 : float.Parse(Config.IniReadValue("GameServer", "轻功二"));
                宠物普通走 = (Config.IniReadValue("GameServer", "宠物普通走") == "") ? 宠物普通走 : float.Parse(Config.IniReadValue("GameServer", "宠物普通走"));
                宠物轻功一 = (Config.IniReadValue("GameServer", "宠物轻功一") == "") ? 宠物轻功一 : float.Parse(Config.IniReadValue("GameServer", "宠物轻功一"));
                宠物轻功二 = (Config.IniReadValue("GameServer", "宠物轻功二") == "") ? 宠物轻功二 : float.Parse(Config.IniReadValue("GameServer", "宠物轻功二"));
                宠物轻功三 = (Config.IniReadValue("GameServer", "宠物轻功三") == "") ? 宠物轻功三 : float.Parse(Config.IniReadValue("GameServer", "宠物轻功三"));
                刀打怪攻击百分比 = ((Config.IniReadValue("GameServer", "刀打怪攻击百分比").Trim().Length == 0) ? World.刀打怪攻击百分比 : double.Parse(Config.IniReadValue("GameServer", "刀打怪攻击百分比").Trim()));
                刀客暴率百分比 = ((Config.IniReadValue("GameServer", "刀客暴率百分比").Trim().Length == 0) ? World.刀客暴率百分比 : double.Parse(Config.IniReadValue("GameServer", "刀客暴率百分比").Trim()));
                剑打怪攻击百分比 = ((Config.IniReadValue("GameServer", "剑打怪攻击百分比").Trim().Length == 0) ? World.剑打怪攻击百分比 : double.Parse(Config.IniReadValue("GameServer", "剑打怪攻击百分比").Trim()));
                枪打怪攻击百分比 = ((Config.IniReadValue("GameServer", "枪打怪攻击百分比").Trim().Length == 0) ? World.枪打怪攻击百分比 : double.Parse(Config.IniReadValue("GameServer", "枪打怪攻击百分比").Trim()));
                弓打怪攻击百分比 = ((Config.IniReadValue("GameServer", "弓打怪攻击百分比").Trim().Length == 0) ? World.弓打怪攻击百分比 : double.Parse(Config.IniReadValue("GameServer", "弓打怪攻击百分比").Trim()));
                医打怪攻击百分比 = ((Config.IniReadValue("GameServer", "医打怪攻击百分比").Trim().Length == 0) ? World.医打怪攻击百分比 : double.Parse(Config.IniReadValue("GameServer", "医打怪攻击百分比").Trim()));
                World.元宝商店开关 = ((Config.IniReadValue("GameServer", "元宝商店开关").Trim() == "") ? World.元宝商店开关 : int.Parse(Config.IniReadValue("GameServer", "元宝商店开关").Trim()));
                World.是否开启共用银币市场 = ((Config.IniReadValue("GameServer", "是否开启共用银币市场").Trim() == "") ? World.是否开启共用银币市场 : int.Parse(Config.IniReadValue("GameServer", "是否开启共用银币市场").Trim()));
                World.换线存档方式 = ((Config.IniReadValue("GameServer", "换线存档方式").Trim() == "") ? World.换线存档方式 : int.Parse(Config.IniReadValue("GameServer", "换线存档方式").Trim()));
                World.换线移动间隔 = ((Config.IniReadValue("GameServer", "换线移动间隔").Trim() == "") ? World.换线移动间隔 : int.Parse(Config.IniReadValue("GameServer", "换线移动间隔").Trim()));
                World.银币服务器IP = Config.IniReadValue("GameServer", "银币服务器IP").Trim();
                World.银币服务器IP2 = Config.IniReadValue("GameServer", "银币服务器IP2").Trim();
                World.银币服务器PORT = Config.IniReadValue("GameServer", "银币服务器PORT").Trim();
                World.主服务器PORT = Config.IniReadValue("GameServer", "主服务器PORT").Trim();
                World.禁止出售物品1 = ((Config.IniReadValue("GameServer", "禁止出售物品1").Trim().Length == 0) ? World.禁止出售物品1 : int.Parse(Config.IniReadValue("GameServer", "禁止出售物品1").Trim()));
                World.禁止出售物品2 = ((Config.IniReadValue("GameServer", "禁止出售物品2").Trim().Length == 0) ? World.禁止出售物品2 : int.Parse(Config.IniReadValue("GameServer", "禁止出售物品2").Trim()));
                World.禁止出售物品3 = ((Config.IniReadValue("GameServer", "禁止出售物品3").Trim().Length == 0) ? World.禁止出售物品3 : int.Parse(Config.IniReadValue("GameServer", "禁止出售物品3").Trim()));
                World.禁止出售物品4 = ((Config.IniReadValue("GameServer", "禁止出售物品4").Trim().Length == 0) ? World.禁止出售物品4 : int.Parse(Config.IniReadValue("GameServer", "禁止出售物品4").Trim()));
                World.禁止出售物品5 = ((Config.IniReadValue("GameServer", "禁止出售物品5").Trim().Length == 0) ? World.禁止出售物品5 : int.Parse(Config.IniReadValue("GameServer", "禁止出售物品5").Trim()));
                //World.势力战奖励类型 = ((Config.IniReadValue("GameServer", "势力战奖励是否开启").Trim() == "") ? World.势力战奖励类型 : int.Parse(Config.IniReadValue("GameServer", "势力战奖励是否开启").Trim()));
                World.势力战奖励个人物品 = ((Config.IniReadValue("GameServer", "势力战奖励个人物品").Trim() == "") ? World.势力战奖励个人物品 : Config.IniReadValue("GameServer", "势力战奖励个人物品").Trim());
                World.游戏登陆端口最大连接数 = ((Config.IniReadValue("GameServer", "游戏登陆端口最大连接数") == "") ? World.游戏登陆端口最大连接数 : int.Parse(Config.IniReadValue("GameServer", "游戏登陆端口最大连接数")));
                World.游戏登陆端口最大连接时间数 = ((Config.IniReadValue("GameServer", "游戏登陆端口最大连接时间数") == "") ? World.游戏登陆端口最大连接时间数 : int.Parse(Config.IniReadValue("GameServer", "游戏登陆端口最大连接时间数")));
                World.自动连接时间 = ((Config.IniReadValue("GameServer", "自动连接时间") == "") ? World.自动连接时间 : int.Parse(Config.IniReadValue("GameServer", "自动连接时间")));
                World.封IP = (Config.IniReadValue("GameServer", "封IP").Trim().ToLower() == "true");
                World.自动开启换端口 = (Config.IniReadValue("GameServer", "自动开启换端口").Trim().ToLower() == "true");
                World.允许最大连接数 = ((Config.IniReadValue("GameServer", "允许最大连接数") == "") ? World.允许最大连接数 : int.Parse(Config.IniReadValue("GameServer", "允许最大连接数")));
                World.断开连接 = (Config.IniReadValue("GameServer", "断开连接").Trim().ToLower() == "true");
                World.加入过滤列表 = (Config.IniReadValue("GameServer", "加入过滤列表").Trim().ToLower() == "true");
                World.关闭连接 = (Config.IniReadValue("GameServer", "关闭连接").Trim().ToLower() == "true");
                World.经验倍数 = ((Config.IniReadValue("GameServer", "经验倍数").Trim() == "") ? World.经验倍数 : double.Parse(Config.IniReadValue("GameServer", "经验倍数").Trim()));
                World.钱倍数 = ((Config.IniReadValue("GameServer", "钱倍数").Trim() == "") ? World.钱倍数 : double.Parse(Config.IniReadValue("GameServer", "钱倍数").Trim()));
                World.历练倍数 = ((Config.IniReadValue("GameServer", "历练倍数").Trim() == "") ? World.历练倍数 : double.Parse(Config.IniReadValue("GameServer", "历练倍数").Trim()));
                World.暴率 = ((Config.IniReadValue("GameServer", "暴率").Trim() == "") ? World.暴率 : int.Parse(Config.IniReadValue("GameServer", "暴率").Trim()));
                World.人怪等级差最小限制 = ((Config.IniReadValue("GameServer", "人怪等级差最小限制").Trim() == "") ? World.人怪等级差最小限制 : int.Parse(Config.IniReadValue("GameServer", "人怪等级差最小限制").Trim()));
                World.最大在线 = ((Config.IniReadValue("GameServer", "最大在线").Trim() == "") ? World.最大在线 : int.Parse(Config.IniReadValue("GameServer", "最大在线").Trim()));
                World.服务器组ID = ((Config.IniReadValue("GameServer", "服务器组ID").Trim() == "") ? World.服务器组ID : int.Parse(Config.IniReadValue("GameServer", "服务器组ID").Trim()));
                World.服务器ID = ((Config.IniReadValue("GameServer", "服务器ID").Trim() == "") ? World.服务器ID : int.Parse(Config.IniReadValue("GameServer", "服务器ID").Trim()));
                World.游戏服务器端口 = ((Config.IniReadValue("GameServer", "游戏服务器端口").Trim() == "") ? World.游戏服务器端口 : int.Parse(Config.IniReadValue("GameServer", "游戏服务器端口").Trim()));
                World.转发器网关服务端口 = ((Config.IniReadValue("GameServer", "转发器网关服务端口").Trim() == "") ? World.转发器网关服务端口 : int.Parse(Config.IniReadValue("GameServer", "转发器网关服务端口").Trim()));
                World.高倍经验开启时间 = ((Config.IniReadValue("GameServer", "高倍经验开启时间").Trim() == "") ? World.高倍经验开启时间 : int.Parse(Config.IniReadValue("GameServer", "高倍经验开启时间").Trim()));
                World.高倍经验结束时间 = ((Config.IniReadValue("GameServer", "高倍经验结束时间").Trim() == "") ? World.高倍经验结束时间 : int.Parse(Config.IniReadValue("GameServer", "高倍经验结束时间").Trim()));
                World.高倍经验倍数 = ((Config.IniReadValue("GameServer", "高倍经验倍数").Trim() == "") ? World.高倍经验倍数 : double.Parse(Config.IniReadValue("GameServer", "高倍经验倍数").Trim()));
                World.打坐获取坐标方式 = ((Config.IniReadValue("GameServer", "打坐获取坐标方式").Trim() == "") ? World.打坐获取坐标方式 : int.Parse(Config.IniReadValue("GameServer", "打坐获取坐标方式").Trim()));
                World.是否封杀锁人功能 = ((Config.IniReadValue("GameServer", "是否封杀锁人功能").Trim() == "") ? World.是否封杀锁人功能 : int.Parse(Config.IniReadValue("GameServer", "是否封杀锁人功能").Trim()));
                World.是否限制无限躺尸 = ((Config.IniReadValue("GameServer", "是否限制无限躺尸").Trim() == "") ? World.是否限制无限躺尸 : int.Parse(Config.IniReadValue("GameServer", "是否限制无限躺尸").Trim()));
                World.武勋丹使用上限 = ((Config.IniReadValue("GameServer", "武勋丹使用上限").Trim() == "") ? World.武勋丹使用上限 : int.Parse(Config.IniReadValue("GameServer", "武勋丹使用上限").Trim()));
                World.限制远程打开NPC = ((Config.IniReadValue("GameServer", "限制远程打开NPC").Trim() == "") ? World.限制远程打开NPC : int.Parse(Config.IniReadValue("GameServer", "限制远程打开NPC").Trim()));
                World.打开NPC限制距离 = ((Config.IniReadValue("GameServer", "打开NPC限制距离").Trim() == "") ? World.打开NPC限制距离 : int.Parse(Config.IniReadValue("GameServer", "打开NPC限制距离").Trim()));
                World.限制连环飞舞确认时间 = ((Config.IniReadValue("GameServer", "限制连环飞舞确认时间").Trim() == "") ? World.限制连环飞舞确认时间 : int.Parse(Config.IniReadValue("GameServer", "限制连环飞舞确认时间").Trim()));
                World.全局测试模式 = ((Config.IniReadValue("GameServer", "全局测试模式").Trim() == "") ? World.全局测试模式 : int.Parse(Config.IniReadValue("GameServer", "全局测试模式").Trim()));
                World.连续快速攻击次数 = ((Config.IniReadValue("GameServer", "连续快速攻击次数").Trim() == "") ? World.连续快速攻击次数 : int.Parse(Config.IniReadValue("GameServer", "连续快速攻击次数").Trim()));
                World.非法攻击外挂操作 = ((Config.IniReadValue("GameServer", "非法攻击外挂操作").Trim() == "") ? World.非法攻击外挂操作 : int.Parse(Config.IniReadValue("GameServer", "非法攻击外挂操作").Trim()));
                World.怪物移动最大范围 = ((Config.IniReadValue("GameServer", "怪物移动最大范围").Trim() == "") ? World.怪物移动最大范围 : float.Parse(Config.IniReadValue("GameServer", "怪物移动最大范围").Trim()));
                World.银币移动测试封包 = ((Config.IniReadValue("GameServer", "银币移动测试封包").Trim() == "") ? World.银币移动测试封包 : int.Parse(Config.IniReadValue("GameServer", "银币移动测试封包").Trim()));
                World.南明湖经验倍数 = ((Config.IniReadValue("GameServer", "南明湖经验倍数").Trim() == "") ? World.南明湖经验倍数 : double.Parse(Config.IniReadValue("GameServer", "南明湖经验倍数").Trim()));
                World.北海经验倍数 = ((Config.IniReadValue("GameServer", "北海经验倍数").Trim() == "") ? World.北海经验倍数 : double.Parse(Config.IniReadValue("GameServer", "北海经验倍数").Trim()));
                队伍单职业经验加成百分比 = ((Config.IniReadValue("GameServer", "队伍单职业经验加成百分比").Trim() == "") ? World.队伍单职业经验加成百分比 : double.Parse(Config.IniReadValue("GameServer", "队伍单职业经验加成百分比").Trim()));
                World.三十五级以下经验倍数 = ((Config.IniReadValue("GameServer", "三十五级以下经验倍数").Trim() == "") ? World.三十五级以下经验倍数 : double.Parse(Config.IniReadValue("GameServer", "三十五级以下经验倍数").Trim()));
                World.六十级以下经验倍数 = ((Config.IniReadValue("GameServer", "六十级以下经验倍数").Trim() == "") ? World.六十级以下经验倍数 : double.Parse(Config.IniReadValue("GameServer", "六十级以下经验倍数").Trim()));
                World.八十级以下经验倍数 = ((Config.IniReadValue("GameServer", "八十级以下经验倍数").Trim() == "") ? World.八十级以下经验倍数 : double.Parse(Config.IniReadValue("GameServer", "八十级以下经验倍数").Trim()));
                World.九十级以下经验倍数 = ((Config.IniReadValue("GameServer", "九十级以下经验倍数").Trim() == "") ? World.九十级以下经验倍数 : double.Parse(Config.IniReadValue("GameServer", "九十级以下经验倍数").Trim()));
                World.百级以下经验倍数 = ((Config.IniReadValue("GameServer", "百级以下经验倍数").Trim() == "") ? World.百级以下经验倍数 : double.Parse(Config.IniReadValue("GameServer", "百级以下经验倍数").Trim()));
                World.百宝阁服务器端口 = ((Config.IniReadValue("GameServer", "百宝阁服务器端口").Trim() == "") ? World.百宝阁服务器端口 : int.Parse(Config.IniReadValue("GameServer", "百宝阁服务器端口").Trim()));
                World.帐号验证服务器端口 = ((Config.IniReadValue("GameServer", "帐号验证服务器端口").Trim() == "") ? World.帐号验证服务器端口 : int.Parse(Config.IniReadValue("GameServer", "帐号验证服务器端口").Trim()));
                World.帐号验证服务器IP = Config.IniReadValue("GameServer", "帐号验证服务器IP").Trim();
                World.vip线 = ((Config.IniReadValue("GameServer", "vip线").Trim() == "") ? 0 : int.Parse(Config.IniReadValue("GameServer", "vip线").Trim()));
                World.PK开关 = ((Config.IniReadValue("GameServer", "PK开关").Trim() == "") ? 0 : int.Parse(Config.IniReadValue("GameServer", "PK开关").Trim()));
                购买间隔 = ((Config.IniReadValue("GameServer", "购买间隔").Trim() == "") ? 购买间隔 : int.Parse(Config.IniReadValue("GameServer", "购买间隔").Trim()));
                交易完成间隔 = ((Config.IniReadValue("GameServer", "交易完成间隔").Trim() == "") ? 交易完成间隔 : int.Parse(Config.IniReadValue("GameServer", "交易完成间隔").Trim()));

                交易放物品间隔 = ((Config.IniReadValue("GameServer", "交易放物品间隔").Trim() == "") ? 交易放物品间隔 : int.Parse(Config.IniReadValue("GameServer", "交易放物品间隔").Trim()));
                World.是否限制加速器 = ((Config.IniReadValue("GameServer", "是否限制加速器").Trim() == "") ? World.是否限制加速器 : int.Parse(Config.IniReadValue("GameServer", "是否限制加速器").Trim()));
                World.是否校验机器码 = ((Config.IniReadValue("GameServer", "是否校验机器码").Trim() == "") ? World.是否校验机器码 : int.Parse(Config.IniReadValue("GameServer", "是否校验机器码").Trim()));
                World.加速检查次数 = ((Config.IniReadValue("GameServer", "加速检查次数").Trim() == "") ? World.加速检查次数 : int.Parse(Config.IniReadValue("GameServer", "加速检查次数").Trim()));
                World.限制加速器时间 = ((Config.IniReadValue("GameServer", "限制加速器时间").Trim() == "") ? World.限制加速器时间 : int.Parse(Config.IniReadValue("GameServer", "限制加速器时间").Trim()));
                World.外挂锁人时间 = ((Config.IniReadValue("GameServer", "外挂锁人时间").Trim() == "") ? World.外挂锁人时间 : int.Parse(Config.IniReadValue("GameServer", "外挂锁人时间").Trim()));
                World.外挂检测操作 = ((Config.IniReadValue("GameServer", "外挂检测操作").Trim() == "") ? World.外挂检测操作 : int.Parse(Config.IniReadValue("GameServer", "外挂检测操作").Trim()));
                World.攻击加速检查次数 = ((Config.IniReadValue("GameServer", "攻击加速检查次数").Trim() == "") ? World.攻击加速检查次数 : int.Parse(Config.IniReadValue("GameServer", "攻击加速检查次数").Trim()));
                World.武功连击有效时间 = ((Config.IniReadValue("GameServer", "武功连击有效时间").Trim() == "") ? World.武功连击有效时间 : int.Parse(Config.IniReadValue("GameServer", "武功连击有效时间").Trim()));
                World.武功连击冷却时间 = ((Config.IniReadValue("GameServer", "武功连击冷却时间").Trim() == "") ? World.武功连击冷却时间 : int.Parse(Config.IniReadValue("GameServer", "武功连击冷却时间").Trim()));
                World.连续攻击有效时间 = ((Config.IniReadValue("GameServer", "连续攻击有效时间").Trim() == "") ? World.连续攻击有效时间 : int.Parse(Config.IniReadValue("GameServer", "连续攻击有效时间").Trim()));
                World.限制技能优化 = ((Config.IniReadValue("GameServer", "限制技能优化").Trim() == "") ? World.限制技能优化 : int.Parse(Config.IniReadValue("GameServer", "限制技能优化").Trim()));
                World.封杀打坐杀怪 = (Config.IniReadValue("GameServer", "封杀打坐杀怪").Trim().ToLower() == "true");
                World.封杀无限打坐卡技能 = (Config.IniReadValue("GameServer", "封杀无限打坐卡技能").Trim().ToLower() == "true");
                World.是否开启BOSS挑战 = ((Config.IniReadValue("GameServer", "是否开启BOSS挑战").Trim() == "") ? World.是否开启BOSS挑战 : int.Parse(Config.IniReadValue("GameServer", "是否开启BOSS挑战").Trim()));
                World.门派正邪加人 = ((Config.IniReadValue("GameServer", "门派正邪加人").Trim() == "") ? World.门派正邪加人 : int.Parse(Config.IniReadValue("GameServer", "门派正邪加人").Trim()));
                try
                {
                    string text = Config.IniReadValue("GameServer", "移动加速检查速度").Trim();
                    if (text != "")
                    {
                        string[] array2 = text.Split(new char[]
                        {
                            ';'
                        });
                        if (array2.Length > 5)
                        {
                            for (int j = 0; j < array2.Length; j++)
                            {
                                World.移动加速检查速度[j] = float.Parse(array2[j]);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Form1.WriteLine(100, "移动加速检查速度读取错误 " + ex.Source);
                }
                组队范围 = ((Config.IniReadValue("GameServer", "组队范围").Trim() == "") ? World.组队范围 : int.Parse(Config.IniReadValue("GameServer", "组队范围").Trim()));
                隔体传功是否开启 = ((Config.IniReadValue("GameServer", "隔体传功是否开启").Trim() == "") ? World.隔体传功是否开启 : int.Parse(Config.IniReadValue("GameServer", "隔体传功是否开启").Trim()));

                World.移动加速检查次数 = ((Config.IniReadValue("GameServer", "移动加速检查次数").Trim() == "") ? World.移动加速检查次数 : int.Parse(Config.IniReadValue("GameServer", "移动加速检查次数").Trim()));
                World.移动加速检查周期 = ((Config.IniReadValue("GameServer", "移动加速检查周期").Trim() == "") ? World.移动加速检查周期 : int.Parse(Config.IniReadValue("GameServer", "移动加速检查周期").Trim()));
                World.是否上线发送礼品 = ((Config.IniReadValue("GameServer", "是否上线发送礼品").Trim() == "") ? World.是否上线发送礼品 : int.Parse(Config.IniReadValue("GameServer", "是否上线发送礼品").Trim()));
                World.新老玩家回归奖励 = ((Config.IniReadValue("GameServer", "新老玩家回归奖励").Trim() == "") ? World.新老玩家回归奖励 : int.Parse(Config.IniReadValue("GameServer", "新老玩家回归奖励").Trim()));
                World.老玩家回归等级限制 = ((Config.IniReadValue("GameServer", "老玩家回归等级限制").Trim() == "") ? World.老玩家回归等级限制 : int.Parse(Config.IniReadValue("GameServer", "老玩家回归等级限制").Trim()));
                World.上线礼品标识码 = ((Config.IniReadValue("GameServer", "上线礼品标识码").Trim() == "") ? World.上线礼品标识码 : int.Parse(Config.IniReadValue("GameServer", "上线礼品标识码").Trim()));
                World.狮吼功元宝金币切换开关 = ((Config.IniReadValue("GameServer", "狮吼功元宝金币切换开关").Trim() == "") ? World.狮吼功元宝金币切换开关 : int.Parse(Config.IniReadValue("GameServer", "狮吼功元宝金币切换开关").Trim()));
                World.狮吼功需要元宝 = ((Config.IniReadValue("GameServer", "狮吼功需要元宝").Trim() == "") ? World.狮吼功需要元宝 : int.Parse(Config.IniReadValue("GameServer", "狮吼功需要元宝").Trim()));
                World.狮吼功需要游戏币 = ((Config.IniReadValue("GameServer", "狮吼功需要游戏币").Trim() == "") ? World.狮吼功需要游戏币 : int.Parse(Config.IniReadValue("GameServer", "狮吼功需要游戏币").Trim()));
                World.势力战是否开启 = ((Config.IniReadValue("GameServer", "势力战是否开启").Trim() == "") ? World.势力战是否开启 : int.Parse(Config.IniReadValue("GameServer", "势力战是否开启").Trim()));
                if (World.势力战是否开启 == 1)
                {
                    World.三转势力战开启小时 = int.Parse(Config.IniReadValue("GameServer", "三转势力战开启小时").Trim());
                    World.四转势力战开启小时 = int.Parse(Config.IniReadValue("GameServer", "四转势力战开启小时").Trim());
                    World.势力战开启分 = int.Parse(Config.IniReadValue("GameServer", "势力战开启分").Trim());
                    World.势力战开启秒 = int.Parse(Config.IniReadValue("GameServer", "势力战开启秒").Trim());
                    //World.势力战参战等级 = ((Config.IniReadValue("GameServer", "势力战限制等级").Trim() == "") ? 0 : int.Parse(Config.IniReadValue("GameServer", "势力战限制等级").Trim()));
                }
                势力战时长 = int.Parse(Config.IniReadValue("GameServer", "势力战时长").Trim());
                World.势力战随机奖励物品 = ((Config.IniReadValue("GameServer", "势力战随机奖励物品").Trim().Length == 0) ? World.势力战随机奖励物品 : int.Parse(Config.IniReadValue("GameServer", "势力战随机奖励物品").Trim()));
                World.势力战前五名奖励武勋 = ((Config.IniReadValue("GameServer", "势力战前五名奖励武勋").Trim().Length == 0) ? World.势力战前五名奖励武勋 : int.Parse(Config.IniReadValue("GameServer", "势力战前五名奖励武勋").Trim()));
                World.势力战五到十名奖励武勋 = ((Config.IniReadValue("GameServer", "势力战五到十名奖励武勋").Trim().Length == 0) ? World.势力战五到十名奖励武勋 : int.Parse(Config.IniReadValue("GameServer", "势力战五到十名奖励武勋").Trim()));
                World.势力战十到二十名奖励武勋 = ((Config.IniReadValue("GameServer", "势力战十到二十名奖励武勋").Trim().Length == 0) ? World.势力战十到二十名奖励武勋 : int.Parse(Config.IniReadValue("GameServer", "势力战十到二十名奖励武勋").Trim()));
                World.势力战二十到五十名奖励武勋 = ((Config.IniReadValue("GameServer", "势力战二十到五十名奖励武勋").Trim().Length == 0) ? World.势力战二十到五十名奖励武勋 : int.Parse(Config.IniReadValue("GameServer", "势力战二十到五十名奖励武勋").Trim()));
                World.势力战基础奖励武勋 = ((Config.IniReadValue("GameServer", "势力战基础奖励武勋").Trim().Length == 0) ? World.势力战基础奖励武勋 : int.Parse(Config.IniReadValue("GameServer", "势力战基础奖励武勋").Trim()));

                World.势力战限制进入时间 = ((Config.IniReadValue("GameServer", "势力战限制进入时间").Trim() == "") ? World.势力战限制进入时间 : int.Parse(Config.IniReadValue("GameServer", "势力战限制进入时间").Trim()));
                World.门战是否开启 = ((Config.IniReadValue("GameServer", "门战是否开启").Trim() == "") ? World.门战是否开启 : int.Parse(Config.IniReadValue("GameServer", "门战是否开启").Trim()));
                World.门战地图 = ((Config.IniReadValue("GameServer", "门战地图").Trim() == "") ? World.门战地图 : int.Parse(Config.IniReadValue("GameServer", "门战地图").Trim()));
                World.门战开启小时1 = ((Config.IniReadValue("GameServer", "门战开启小时").Trim() == "") ? World.门战开启小时1 : int.Parse(Config.IniReadValue("GameServer", "门战开启小时").Trim()));
                World.门战限制等级 = ((Config.IniReadValue("GameServer", "门战限制等级").Trim() == "") ? World.门战限制等级 : int.Parse(Config.IniReadValue("GameServer", "门战限制等级").Trim()));
                World.门战需要金币 = ((Config.IniReadValue("GameServer", "门战需要金币").Trim() == "") ? World.门战需要金币 : int.Parse(Config.IniReadValue("GameServer", "门战需要金币").Trim()));
                World.获胜门派获得武勋 = ((Config.IniReadValue("GameServer", "获胜门派获得武勋").Trim() == "") ? World.获胜门派获得武勋 : int.Parse(Config.IniReadValue("GameServer", "获胜门派获得武勋").Trim()));
                World.失败门派获得武勋 = ((Config.IniReadValue("GameServer", "失败门派获得武勋").Trim() == "") ? World.失败门派获得武勋 : int.Parse(Config.IniReadValue("GameServer", "失败门派获得武勋").Trim()));
                World.门站随机奖励物品 = ((Config.IniReadValue("GameServer", "门站随机奖励物品").Trim() == "") ? World.门站随机奖励物品 : Config.IniReadValue("GameServer", "门站随机奖励物品").Trim());
                门站BOSS = ((Config.IniReadValue("GameServer", "门站BOSS").Trim() == "") ? World.门站BOSS : Config.IniReadValue("GameServer", "门站BOSS").Trim());
                World.副本开始时间 = ((Config.IniReadValue("GameServer", "副本开始时间").Trim() == "") ? World.副本开始时间 : int.Parse(Config.IniReadValue("GameServer", "副本开始时间").Trim()));
                World.副本结束时间 = ((Config.IniReadValue("GameServer", "副本结束时间").Trim() == "") ? World.副本结束时间 : int.Parse(Config.IniReadValue("GameServer", "副本结束时间").Trim()));
                World.副本开启状态 = ((Config.IniReadValue("GameServer", "副本开启状态").Trim() == "") ? World.副本开启状态 : int.Parse(Config.IniReadValue("GameServer", "副本开启状态").Trim()));
                World.副本限制次数 = ((Config.IniReadValue("GameServer", "副本限制次数").Trim() == "") ? World.副本限制次数 : int.Parse(Config.IniReadValue("GameServer", "副本限制次数").Trim()));
                World.封包异步发送 = ((Config.IniReadValue("GameServer", "封包异步发送") == "") ? World.封包异步发送 : int.Parse(Config.IniReadValue("GameServer", "封包异步发送")));
                World.狮子吼最大数 = ((Config.IniReadValue("GameServer", "狮子吼最大数") == "") ? World.狮子吼最大数 : int.Parse(Config.IniReadValue("GameServer", "狮子吼最大数")));
                World.合成率 = ((Config.IniReadValue("GameServer", "合成率") == "") ? World.合成率 : double.Parse(Config.IniReadValue("GameServer", "合成率")));
                World.是否加密 = ((Config.IniReadValue("GameServer", "是否加密").Trim() == "") ? World.是否加密 : int.Parse(Config.IniReadValue("GameServer", "是否加密").Trim()));
                强化几率控制 = Config.IniReadValue("GameServer", "强化几率控制").Trim();
                合成几率控制 = Config.IniReadValue("GameServer", "合成几率控制").Trim();
                属性几率控制 = Config.IniReadValue("GameServer", "属性几率控制").Trim();
                登陆器模式 = int.Parse(DbClss.Config.IniReadValue("GameServer", "登陆器模式").Trim());
                World.版本验证时间 = ((Config.IniReadValue("GameServer", "版本验证时间").Trim() == "") ? World.版本验证时间 : int.Parse(Config.IniReadValue("GameServer", "版本验证时间").Trim()));
                World.创建门派需要等级 = ((Config.IniReadValue("GameServer", "创建门派需要等级").Trim() == "") ? World.创建门派需要等级 : int.Parse(Config.IniReadValue("GameServer", "创建门派需要等级").Trim()));
                World.创建门派所需物品ID = ((Config.IniReadValue("GameServer", "创建门派所需物品ID").Trim() == "") ? World.创建门派所需物品ID : Config.IniReadValue("GameServer", "创建门派所需物品ID").Trim());
                World.安全区开关 = ((Config.IniReadValue("GameServer", "安全区开关").Trim() == "") ? World.安全区开关 : int.Parse(Config.IniReadValue("GameServer", "安全区开关").Trim()));
                World.查非法物品 = ((Config.IniReadValue("GameServer", "查非法物品").Trim() == "") ? World.查非法物品 : int.Parse(Config.IniReadValue("GameServer", "查非法物品").Trim()));
                World.查绑定非法物品 = ((Config.IniReadValue("GameServer", "查绑定非法物品").Trim() == "") ? World.查绑定非法物品 : (Config.IniReadValue("GameServer", "查绑定非法物品").Trim() == "1"));
                World.查非法物品操作 = ((Config.IniReadValue("GameServer", "查非法物品操作").Trim() == "") ? World.查非法物品操作 : int.Parse(Config.IniReadValue("GameServer", "查非法物品操作").Trim()));
                World.物品最高攻击值 = ((Config.IniReadValue("GameServer", "物品最高攻击值").Trim() == "") ? World.物品最高攻击值 : int.Parse(Config.IniReadValue("GameServer", "物品最高攻击值").Trim()));
                World.物品最高防御值 = ((Config.IniReadValue("GameServer", "物品最高防御值").Trim() == "") ? World.物品最高防御值 : int.Parse(Config.IniReadValue("GameServer", "物品最高防御值").Trim()));
                World.物品最高武功值 = ((Config.IniReadValue("GameServer", "物品最高武功值").Trim() == "") ? World.物品最高武功值 : int.Parse(Config.IniReadValue("GameServer", "物品最高武功值").Trim()));
                World.物品最高武防值 = ((Config.IniReadValue("GameServer", "物品最高武防值").Trim() == "") ? World.物品最高武防值 : int.Parse(Config.IniReadValue("GameServer", "物品最高武防值").Trim()));
                World.气功百分比 = ((Config.IniReadValue("GameServer", "气功百分比").Trim() == "") ? World.气功百分比 : double.Parse(Config.IniReadValue("GameServer", "气功百分比").Trim()));
                World.最大气功数 = ((Config.IniReadValue("GameServer", "最大气功数").Trim() == "") ? World.最大气功数 : int.Parse(Config.IniReadValue("GameServer", "最大气功数").Trim()));
                World.SqlJl = ((Config.IniReadValue("GameServer", "SqlJl").Trim() == "") ? World.SqlJl : Config.IniReadValue("GameServer", "SqlJl").Trim());
                World.自动存档 = ((Config.IniReadValue("GameServer", "自动存档").Trim() == "") ? World.自动存档 : int.Parse(Config.IniReadValue("GameServer", "自动存档").Trim()));
                World.PK记录 = ((Config.IniReadValue("GameServer", "PK记录").Trim() == "") ? World.PK记录 : int.Parse(Config.IniReadValue("GameServer", "PK记录").Trim()));
                World.物品记录 = ((Config.IniReadValue("GameServer", "物品记录").Trim() == "") ? World.物品记录 : int.Parse(Config.IniReadValue("GameServer", "物品记录").Trim()));
                World.登陆记录 = ((Config.IniReadValue("GameServer", "登陆记录").Trim() == "") ? World.登陆记录 : int.Parse(Config.IniReadValue("GameServer", "登陆记录").Trim()));
                World.记录保存天数 = ((Config.IniReadValue("GameServer", "记录保存天数").Trim() == "") ? World.记录保存天数 : int.Parse(Config.IniReadValue("GameServer", "记录保存天数").Trim()));
                World.元宝合成 = ((Config.IniReadValue("GameServer", "元宝合成需要元宝").Trim() == "") ? World.元宝合成 : int.Parse(Config.IniReadValue("GameServer", "元宝合成需要元宝").Trim()));
                复制物品是否封号 = ((Config.IniReadValue("GameServer", "复制物品是否封号").Trim() == "") ? World.复制物品是否封号 : int.Parse(Config.IniReadValue("GameServer", "复制物品是否封号").Trim()));
                复制物品检查时间 = ((Config.IniReadValue("GameServer", "复制物品检查时间").Trim() == "") ? World.复制物品检查时间 : int.Parse(Config.IniReadValue("GameServer", "复制物品检查时间").Trim()));
                World.挂机奖励时间周期 = ((Config.IniReadValue("GameServer", "挂机奖励时间周期").Trim() == "") ? World.挂机奖励时间周期 : int.Parse(Config.IniReadValue("GameServer", "挂机奖励时间周期").Trim()));
                World.离线挂机是否开启 = ((Config.IniReadValue("GameServer", "离线挂机是否开启").Trim() == "") ? World.离线挂机是否开启 : int.Parse(Config.IniReadValue("GameServer", "离线挂机是否开启").Trim()));
                World.离线挂机等级限制 = ((Config.IniReadValue("GameServer", "离线挂机等级限制").Trim() == "") ? World.离线挂机等级限制 : ((double)int.Parse(Config.IniReadValue("GameServer", "离线挂机等级限制").Trim())));
                World.新人保护等级 = ((Config.IniReadValue("GameServer", "新人保护等级").Trim() == "") ? World.新人保护等级 : int.Parse(Config.IniReadValue("GameServer", "新人保护等级").Trim()));
                World.组队级别限制 = ((Config.IniReadValue("GameServer", "组队级别限制").Trim() == "") ? World.组队级别限制 : int.Parse(Config.IniReadValue("GameServer", "组队级别限制").Trim()));
                World.PK等级差 = ((Config.IniReadValue("GameServer", "PK等级差").Trim() == "") ? World.PK等级差 : int.Parse(Config.IniReadValue("GameServer", "PK等级差").Trim()));
                World.人物最高等级 = ((Config.IniReadValue("GameServer", "人物最高等级").Trim() == "") ? World.人物最高等级 : int.Parse(Config.IniReadValue("GameServer", "人物最高等级").Trim()));
                World.枪客乾坤挪移 = ((Config.IniReadValue("GameServer", "枪客乾坤挪移").Trim() == "") ? World.枪客乾坤挪移 : double.Parse(Config.IniReadValue("GameServer", "枪客乾坤挪移").Trim()));
                World.枪客灵甲护身 = ((Config.IniReadValue("GameServer", "枪客灵甲护身").Trim() == "") ? World.枪客灵甲护身 : double.Parse(Config.IniReadValue("GameServer", "枪客灵甲护身").Trim()));
                World.灵甲护身加成 = ((Config.IniReadValue("GameServer", "灵甲护身加成").Trim() == "") ? World.灵甲护身加成 : double.Parse(Config.IniReadValue("GameServer", "灵甲护身加成").Trim()));
                World.枪客末日狂舞 = ((Config.IniReadValue("GameServer", "枪客末日狂舞").Trim() == "") ? World.枪客末日狂舞 : double.Parse(Config.IniReadValue("GameServer", "枪客末日狂舞").Trim()));
                World.剑客回柳身法 = ((Config.IniReadValue("GameServer", "剑客回柳身法").Trim() == "") ? World.剑客回柳身法 : double.Parse(Config.IniReadValue("GameServer", "剑客回柳身法").Trim()));
                World.弓手攻击倍数 = ((Config.IniReadValue("GameServer", "弓手攻击倍数").Trim() == "") ? World.弓手攻击倍数 : double.Parse(Config.IniReadValue("GameServer", "弓手攻击倍数").Trim()));
                World.医生长工系数 = ((Config.IniReadValue("GameServer", "医生长工系数").Trim() == "") ? World.医生长工系数 : double.Parse(Config.IniReadValue("GameServer", "医生长工系数").Trim()));
                World.武功攻击倍数 = ((Config.IniReadValue("GameServer", "武功攻击倍数").Trim() == "") ? World.武功攻击倍数 : double.Parse(Config.IniReadValue("GameServer", "武功攻击倍数").Trim()));
                World.武功攻击力控制 = ((Config.IniReadValue("GameServer", "武功攻击力控制").Trim() == "") ? World.武功攻击力控制 : double.Parse(Config.IniReadValue("GameServer", "武功攻击力控制").Trim()));
                World.武功防御力控制 = ((Config.IniReadValue("GameServer", "武功防御力控制").Trim() == "") ? World.武功防御力控制 : double.Parse(Config.IniReadValue("GameServer", "武功防御力控制").Trim()));
                World.装备加解锁开关 = ((Config.IniReadValue("GameServer", "装备加解锁开关").Trim() == "") ? World.装备加解锁开关 : int.Parse(Config.IniReadValue("GameServer", "装备加解锁开关").Trim()));
                World.加锁元宝数 = ((Config.IniReadValue("GameServer", "加锁元宝数").Trim() == "") ? World.加锁元宝数 : int.Parse(Config.IniReadValue("GameServer", "加锁元宝数").Trim()));
                World.解锁元宝数 = ((Config.IniReadValue("GameServer", "解锁元宝数").Trim() == "") ? World.解锁元宝数 : int.Parse(Config.IniReadValue("GameServer", "解锁元宝数").Trim()));
                World.加锁金币数 = ((Config.IniReadValue("GameServer", "加锁金币数").Trim() == "") ? World.加锁金币数 : int.Parse(Config.IniReadValue("GameServer", "加锁金币数").Trim()));
                World.解锁金币数 = ((Config.IniReadValue("GameServer", "解锁金币数").Trim() == "") ? World.解锁金币数 : int.Parse(Config.IniReadValue("GameServer", "解锁金币数").Trim()));
                World.强化公告等级 = ((Config.IniReadValue("GameServer", "强化公告等级").Trim() == "") ? World.强化公告等级 : int.Parse(Config.IniReadValue("GameServer", "强化公告等级").Trim()));
                World.武勋保护药品 = ((Config.IniReadValue("GameServer", "武勋保护药品ID").Trim() == "") ? World.武勋保护药品 : int.Parse(Config.IniReadValue("GameServer", "武勋保护药品ID").Trim()));
                World.武勋解保护药品 = ((Config.IniReadValue("GameServer", "武勋解保护药品ID").Trim() == "") ? World.武勋解保护药品 : int.Parse(Config.IniReadValue("GameServer", "武勋解保护药品ID").Trim()));
                World.扔物品操作 = ((Config.IniReadValue("GameServer", "扔物品操作").Trim() == "") ? World.扔物品操作 : int.Parse(Config.IniReadValue("GameServer", "扔物品操作").Trim()));
                World.医生弓手攻击距离 = ((Config.IniReadValue("GameServer", "医生弓手攻击可视距离").Trim() == "") ? World.医生弓手攻击距离 : int.Parse(Config.IniReadValue("GameServer", "医生弓手攻击可视距离").Trim()));
                World.刀枪剑攻击距离 = ((Config.IniReadValue("GameServer", "刀枪剑攻击可视距离").Trim() == "") ? World.刀枪剑攻击距离 : int.Parse(Config.IniReadValue("GameServer", "刀枪剑攻击可视距离").Trim()));
                World.是否开启死亡掉经验 = ((Config.IniReadValue("GameServer", "是否开启死亡掉经验").Trim() == "") ? World.是否开启死亡掉经验 : int.Parse(Config.IniReadValue("GameServer", "是否开启死亡掉经验").Trim()));
                World.死亡掉经验开始等级 = ((Config.IniReadValue("GameServer", "死亡掉经验开始等级").Trim() == "") ? World.死亡掉经验开始等级 : int.Parse(Config.IniReadValue("GameServer", "死亡掉经验开始等级").Trim()));
                World.死亡掉经验比例 = ((Config.IniReadValue("GameServer", "死亡掉经验比例").Trim() == "") ? World.死亡掉经验比例 : int.Parse(Config.IniReadValue("GameServer", "死亡掉经验比例").Trim()));
                World.死亡复活锁定时间 = ((Config.IniReadValue("GameServer", "死亡复活锁定时间").Trim() == "") ? World.死亡复活锁定时间 : int.Parse(Config.IniReadValue("GameServer", "死亡复活锁定时间").Trim()));
                World.是否开启师徒系统 = ((Config.IniReadValue("GameServer", "是否开启师徒系统").Trim() == "") ? World.是否开启师徒系统 : int.Parse(Config.IniReadValue("GameServer", "是否开启师徒系统").Trim()));
                World.徒弟最高等级限制 = ((Config.IniReadValue("GameServer", "徒弟最高等级限制").Trim() == "") ? World.徒弟最高等级限制 : int.Parse(Config.IniReadValue("GameServer", "徒弟最高等级限制").Trim()));
                World.存储过程优化 = ((Config.IniReadValue("GameServer", "存储过程优化").Trim() == "") ? World.存储过程优化 : int.Parse(Config.IniReadValue("GameServer", "存储过程优化").Trim()));
                World.再造系统是否开启 = ((Config.IniReadValue("GameServer", "再造系统是否开启").Trim() == "") ? World.再造系统是否开启 : int.Parse(Config.IniReadValue("GameServer", "再造系统是否开启").Trim()));
                World.是否开启土豪系统 = ((Config.IniReadValue("GameServer", "是否开启土豪系统").Trim() == "") ? World.是否开启土豪系统 : int.Parse(Config.IniReadValue("GameServer", "是否开启土豪系统").Trim()));
                World.兑换五色需要积分数量 = ((Config.IniReadValue("GameServer", "兑换五色需要积分数量").Trim() == "") ? World.兑换五色需要积分数量 : int.Parse(Config.IniReadValue("GameServer", "兑换五色需要积分数量").Trim()));
                World.积分兑换武勋数量 = ((Config.IniReadValue("GameServer", "积分兑换武勋数量").Trim() == "") ? World.积分兑换武勋数量 : int.Parse(Config.IniReadValue("GameServer", "积分兑换武勋数量").Trim()));
                World.武勋丹需要积分数量 = ((Config.IniReadValue("GameServer", "武勋丹需要积分数量").Trim() == "") ? World.武勋丹需要积分数量 : int.Parse(Config.IniReadValue("GameServer", "武勋丹需要积分数量").Trim()));
                World.全服土豪需要积分 = ((Config.IniReadValue("GameServer", "全服土豪需要积分").Trim() == "") ? World.全服土豪需要积分 : int.Parse(Config.IniReadValue("GameServer", "全服土豪需要积分").Trim()));
                World.全服土豪需要元宝 = ((Config.IniReadValue("GameServer", "全服土豪需要元宝").Trim() == "") ? World.全服土豪需要元宝 : int.Parse(Config.IniReadValue("GameServer", "全服土豪需要元宝").Trim()));
                World.队伍土豪需要元宝 = ((Config.IniReadValue("GameServer", "队伍土豪需要元宝").Trim() == "") ? World.队伍土豪需要元宝 : int.Parse(Config.IniReadValue("GameServer", "队伍土豪需要元宝").Trim()));
                World.队伍土豪需要金币 = ((Config.IniReadValue("GameServer", "队伍土豪需要金币").Trim() == "") ? World.队伍土豪需要金币 : int.Parse(Config.IniReadValue("GameServer", "队伍土豪需要金币").Trim()));
                World.队伍土豪需要积分 = ((Config.IniReadValue("GameServer", "队伍土豪需要积分").Trim() == "") ? World.队伍土豪需要积分 : int.Parse(Config.IniReadValue("GameServer", "队伍土豪需要积分").Trim()));
                World.追杀系统需要元宝 = ((Config.IniReadValue("GameServer", "追杀系统需要元宝").Trim() == "") ? World.追杀系统需要元宝 : int.Parse(Config.IniReadValue("GameServer", "追杀系统需要元宝").Trim()));
                World.BOSS权限需要积分 = ((Config.IniReadValue("GameServer", "BOSS权限需要积分").Trim() == "") ? World.BOSS权限需要积分 : int.Parse(Config.IniReadValue("GameServer", "BOSS权限需要积分").Trim()));
                World.BOSS初始化次数 = ((Config.IniReadValue("GameServer", "BOSS初始化次数").Trim() == "") ? World.BOSS初始化次数 : int.Parse(Config.IniReadValue("GameServer", "BOSS初始化次数").Trim()));
                World.BOSS金符持有初始化次数 = ((Config.IniReadValue("GameServer", "BOSS金符持有初始化次数").Trim() == "") ? World.BOSS金符持有初始化次数 : int.Parse(Config.IniReadValue("GameServer", "BOSS金符持有初始化次数").Trim()));
                World.是否开启气功提示 = ((Config.IniReadValue("GameServer", "是否开启气功提示").Trim() == "") ? World.是否开启气功提示 : int.Parse(Config.IniReadValue("GameServer", "是否开启气功提示").Trim()));
                World.是否开启查看装备功能 = ((Config.IniReadValue("GameServer", "是否开启查看装备功能").Trim() == "") ? World.是否开启查看装备功能 : int.Parse(Config.IniReadValue("GameServer", "是否开启查看装备功能").Trim()));
                World.最大钱数 = ((Config.IniReadValue("GameServer", "限制玩家最大金币数").Trim() == "") ? World.最大钱数 : int.Parse(Config.IniReadValue("GameServer", "限制玩家最大金币数").Trim()));
                World.最大元宝数 = ((Config.IniReadValue("GameServer", "限制玩家最大元宝数").Trim() == "") ? World.最大元宝数 : int.Parse(Config.IniReadValue("GameServer", "限制玩家最大元宝数").Trim()));
                World.是否开启跨线传音 = ((Config.IniReadValue("GameServer", "是否开启跨线传音").Trim() == "") ? World.是否开启跨线传音 : int.Parse(Config.IniReadValue("GameServer", "是否开启跨线传音").Trim()));
                World.窗口名检测模式 = ((Config.IniReadValue("GameServer", "窗口名检测模式").Trim() == "") ? World.窗口名检测模式 : int.Parse(Config.IniReadValue("GameServer", "窗口名检测模式").Trim()));
                int num2 = 0;
                try
                {
                    World.地图锁定 = Config.IniReadValue("GameServer", "地图锁定").Trim();
                    string text2 = Config.IniReadValue("GameServer", "挂机奖励");
                    //string text3 = Config.IniReadValue("GameServer", "势力战奖励");
                    //string text4 = Config.IniReadValue("GameServer", "势力战失败奖励");
                    Config.IniReadValue("GameServer", "帮派混战胜利奖励");
                    Config.IniReadValue("GameServer", "帮派混战失败奖励");
                    for (int k = 0; k < 5; k++)
                    {
                        World.挂机奖励[k] = int.Parse(text2.Split(new char[]
                        {
                            ','
                        })[k]);

                    }
                    World.金符地图 = Config.IniReadValue("GameServer", "金符地图").Trim();
                }
                catch (Exception ex2)
                {
                    Form1.WriteLine(100, "配置文件加载挂机奖励，势力战奖励，帮派混战战奖励错误:" + ex2.Message);
                }
                try
                {
                    string text5 = (Config.IniReadValue("GameServer", "限制PK地图").Trim() == "") ? "" : Config.IniReadValue("GameServer", "限制PK地图").Trim();
                    World.限制PK地图列表.Clear();
                    if (text5 != "")
                    {
                        num2 = 1;
                        string[] array3 = text5.Split(new char[]
                        {
                            ';'
                        });
                        string[] array4 = array3;
                        for (int l = 0; l < array4.Length; l++)
                        {
                            string s = array4[l];
                            if (!World.限制PK地图列表.Contains(int.Parse(s)))
                            {
                                World.限制PK地图列表.Add(int.Parse(s));
                            }
                        }
                        num2 = 2;
                    }
                    string text6 = (Config.IniReadValue("GameServer", "限时间PK地图").Trim() == "") ? "" : Config.IniReadValue("GameServer", "限时间PK地图").Trim();
                    World.限时PK地图列表.Clear();
                    if (text6 != "")
                    {
                        num2 = 3;
                        string[] array5 = text6.Split(new char[]
                        {
                            ';'
                        });
                        string[] array6 = array5;
                        for (int m = 0; m < array6.Length; m++)
                        {
                            string s2 = array6[m];
                            if (!World.限时PK地图列表.Contains(int.Parse(s2)))
                            {
                                World.限时PK地图列表.Add(int.Parse(s2));
                            }
                        }
                        num2 = 4;
                    }
                    World.限时地图开PK时间 = ((Config.IniReadValue("GameServer", "限时地图开PK时间").Trim() == "") ? World.限时地图开PK时间 : int.Parse(Config.IniReadValue("GameServer", "限时地图开PK时间").Trim()));
                    World.工作日限时地图开PK时间 = ((Config.IniReadValue("GameServer", "工作日限时地图开PK时间").Trim() == "") ? World.工作日限时地图开PK时间 : int.Parse(Config.IniReadValue("GameServer", "工作日限时地图开PK时间").Trim()));
                    World.限时地图关PK时间 = ((Config.IniReadValue("GameServer", "限时地图关PK时间").Trim() == "") ? World.限时地图关PK时间 : int.Parse(Config.IniReadValue("GameServer", "限时地图关PK时间").Trim()));
                    World.工作日限时地图关PK时间 = ((Config.IniReadValue("GameServer", "工作日限时地图关PK时间").Trim() == "") ? World.工作日限时地图关PK时间 : int.Parse(Config.IniReadValue("GameServer", "工作日限时地图关PK时间").Trim()));
                    World.周末全天PK是否开启 = ((Config.IniReadValue("GameServer", "周末全天PK是否开启").Trim() == "") ? World.周末全天PK是否开启 : int.Parse(Config.IniReadValue("GameServer", "周末全天PK是否开启").Trim()));
                    string text7 = (Config.IniReadValue("GameServer", "全天PK地图").Trim() == "") ? "1301;2001;5001" : Config.IniReadValue("GameServer", "全天PK地图").Trim();
                    World.周末全天PK地图列表.Clear();
                    num2 = 5;
                    if (text7 != "")
                    {
                        num2 = 6;
                        string[] array7 = text7.Split(new char[]
                        {
                            ';'
                        });
                        string[] array8 = array7;
                        for (int n = 0; n < array8.Length; n++)
                        {
                            string s3 = array8[n];
                            if (!World.周末全天PK地图列表.Contains(int.Parse(s3)))
                            {
                                World.周末全天PK地图列表.Add(int.Parse(s3));
                            }
                        }
                        num2 = 7;
                    }
                    string text8 = Config.IniReadValue("GameServer", "物品锁定").Trim();
                    World.锁定物品列表.Clear();
                    num2 = 8;
                    if (text8 != "")
                    {
                        num2 = 9;
                        string[] array9 = text8.Split(new char[]
                        {
                            ','
                        });
                        string[] array10 = array9;
                        for (int num3 = 0; num3 < array10.Length; num3++)
                        {
                            string s4 = array10[num3];
                            if (!World.锁定物品列表.Contains(int.Parse(s4)))
                            {
                                World.锁定物品列表.Add(int.Parse(s4));
                            }
                        }
                        num2 = 10;
                    }
                    string text9 = (Config.IniReadValue("GameServer", "查复制全局ID").Trim() == "") ? "" : Config.IniReadValue("GameServer", "查复制全局ID").Trim();
                    World.查复制物品列表.Clear();
                    num2 = 11;
                    if (text9 != "")
                    {
                        num2 = 12;
                        string[] array11 = text9.Split(new char[]
                        {
                            ','
                        });
                        string[] array12 = array11;
                        for (int num4 = 0; num4 < array12.Length; num4++)
                        {
                            string s5 = array12[num4];
                            if (!World.查复制物品列表.Contains(long.Parse(s5)))
                            {
                                World.查复制物品列表.Add(long.Parse(s5));
                            }
                        }
                        num2 = 13;
                    }
                    Form1.WriteLine(2, "加载物品锁定列表完成" + World.锁定物品列表.Count.ToString());
                    string text10 = (Config.IniReadValue("GameServer", "挂机奖励地图").Trim() == "") ? "" : Config.IniReadValue("GameServer", "挂机奖励地图").Trim();
                    World.挂机奖励地图.Clear();
                    num2 = 16;
                    if (text10 != "")
                    {
                        string[] array13 = text10.Split(new char[]
                        {
                            ';'
                        });
                        for (int num5 = 0; num5 < array13.Length; num5++)
                        {
                            try
                            {
                                int item = int.Parse(array13[num5]);
                                World.挂机奖励地图.Add(item);
                            }
                            catch
                            {
                            }
                        }
                        num2 = 17;
                    }
                    string text11 = (Config.IniReadValue("GameServer", "需要任务等级列表").Trim() == "") ? "" : Config.IniReadValue("GameServer", "需要任务等级列表").Trim();
                    World.lockLevel.Clear();
                    num2 = 18;
                    if (text11 != "")
                    {
                        string[] array14 = text11.Split(new char[]
                        {
                            ';'
                        });
                        for (int num6 = 0; num6 < array14.Length; num6++)
                        {
                            int item2 = int.Parse(array14[num6]);
                            World.lockLevel.Add(item2);
                        }
                        num2 = 19;
                    }
                    World.寄售系统是否开启 = ((Config.IniReadValue("GameServer", "寄售系统是否开启").Trim() == "") ? World.寄售系统是否开启 : int.Parse(Config.IniReadValue("GameServer", "寄售系统是否开启").Trim()));
                    World.寄售获得元宝比例 = ((Config.IniReadValue("GameServer", "寄售获得元宝比例").Trim() == "") ? World.寄售获得元宝比例 : double.Parse(Config.IniReadValue("GameServer", "寄售获得元宝比例").Trim()));
                    World.是否可以寄售绑定装备 = ((Config.IniReadValue("GameServer", "是否可以寄售绑定装备").Trim() == "") ? World.是否可以寄售绑定装备 : int.Parse(Config.IniReadValue("GameServer", "是否可以寄售绑定装备").Trim()));
                    World.允许交易等级 = ((Config.IniReadValue("GameServer", "允许交易等级").Trim() == "") ? World.允许交易等级 : int.Parse(Config.IniReadValue("GameServer", "允许交易等级").Trim()));
                    World.允许交易披风 = ((Config.IniReadValue("GameServer", "允许交易披风").Trim() == "") ? World.允许交易披风 : int.Parse(Config.IniReadValue("GameServer", "允许交易披风").Trim()));
                    是否允许开店 = ((Config.IniReadValue("GameServer", "是否允许开店").Trim() == "") ? World.是否允许开店 : int.Parse(Config.IniReadValue("GameServer", "是否允许开店").Trim()));
                    num2 = 20;
                }
                catch (Exception ex3)
                {
                    Form1.WriteLine(100, num2 + " 配置文件加载挂机地图表错误:" + ex3.Message);
                }
            }
            catch (Exception arg)
            {
                Form1.WriteLine(100, "配置文件 config.ini 配置错误:" + arg);
            }
        }

        private static void Thread1()
        {
        }

        public void SetConfig3()
        {
            try
            {

                string[] kkk = Key.Split(';');
                SymmetricMethod md5 = new SymmetricMethod();
                string kke = md5.Decrypto(Key);
                string[] kk = kke.Split('|');
                if (kk.Length >= 4)
                {
                    //DateTime Pktime = DateTime.Now;
                    //Console.WriteLine(Pktime + " " + Pktime.Millisecond);
                    if (Hasher.GetCpuID() != World.pWord(kk[0], 2) || Hasher.GetDriveID("C") != World.pWord(kk[1], 2) || Hasher.GetIP() != World.pWord(kk[2], 2) || Hasher.GetMac() != World.pWord(kk[3], 2))
                    {
                        //Form1.WriteLine(100, "没有注册 注册号:" + md5.Encrypto(Hasher.GetMac() + "|" + Hasher.GetIP() + "|" + Hasher.GetDriveID("C") + "|" + Hasher.GetCpuID()) + "|" + Hasher.GetIP());
                        //Form1.WriteLine(100, "没有注册 注册号:" + md5.Encrypto(Hasher.GetMac() + "|" + Hasher.GetIP() + "|" + Hasher.GetDriveID("C")) + "|" + Hasher.GetIP());
                        Environment.Exit(0);
                    }
                    else
                    {
                        if (kk.Length >= 5)
                        {
                            if (double.Parse(World.pWord(kk[4], 2)) < ServerVer)
                            {
                                Environment.Exit(0);
                            }
                        }
                        World.Keyk.CpuID = World.pWord(kk[0], 2);
                        World.Keyk.DriveID = World.pWord(kk[1], 2);
                        World.Keyk.IP = World.pWord(kk[2], 2);
                        World.Keyk.Mac = World.pWord(kk[3], 2);
                    }
                }
                else
                {
                    //Form1.WriteLine(100, "没有注册 注册号:" + md5.Encrypto(Hasher.GetMac() + "|" + Hasher.GetIP() + "|" + Hasher.GetDriveID("C") + "|" + Hasher.GetCpuID()) + "|" + Hasher.GetIP());
                    //Form1.WriteLine(100, "没有注册 注册号:" + md5.Encrypto(Hasher.GetMac() + "|" + Hasher.GetIP() + "|" + Hasher.GetDriveID("C")) + "|" + Hasher.GetIP());
                    Environment.Exit(0);
                }
                //if (World.Keyk.CpuID != World.KeykF.CpuID || World.Keyk.DriveID != World.KeykF.DriveID || World.Keyk.IP != World.KeykF.IP || World.Keyk.Mac != World.KeykF.Mac)
                //{
                //    //Form1.WriteLine(100, "9");
                //    Environment.Exit(0);
                //}
                //else if (World.KeykF.IP.Length < 4 || World.KeykF.Mac.Length < 4 || World.Keyk.IP.Length < 4 || World.Keyk.Mac.Length < 4)
                //{
                //    //Form1.WriteLine(100, "10");
                //    Environment.Exit(0);
                //}
            }
            catch (Exception exception1)
            {
                //Form1.WriteLine(1, "系统错误:" + exception1.Message);
                //Form1.WriteLine(1, "11" + exception1.Message);
                Environment.Exit(0);
            }
        }
        public void SetConfig4()
        {
            try
            {
                string[] kkk = Key.Split(';');
                //Form1.WriteLine(100, "没有注册 注册号:" + Key2);
                Class2 md5 = new Class2();
                //SymmetricMethod md5 = new SymmetricMethod();
                string kke = md5.DecryptByPublicKey(Key2);
                string[] kk = kke.Split('|');
                if (kk.Length >= 4)
                {
                    if (Hasher.GetCpuID() != World.pWord(kk[0], 2) || Hasher.GetIP() != World.pWord(kk[2], 2) || Hasher.GetMac() != World.pWord(kk[3], 2))
                    {
                        Environment.Exit(0);
                    }
                    else
                    {
                        if (kk.Length >= 5)
                        {
                            if (double.Parse(World.pWord(kk[4], 2)) < ServerVer)
                            {
                                Environment.Exit(0);
                            }
                        }
                        World.KeykF.CpuID = World.pWord(kk[0], 2);
                        World.KeykF.DriveID = World.pWord(kk[1], 2);
                        World.KeykF.IP = World.pWord(kk[2], 2);
                        World.KeykF.Mac = World.pWord(kk[3], 2);
                        World.KeykF.SJtime = World.pWord(kk[5], 2);
                    }
                }
                else
                {
                    //Form1.WriteLine(100, "没有注册 注册号6:" + Key2);
                    //Form1.WriteLine(100, "5" + Hasher.GetDriveID("C") + "|" + World.pWord(kk[1], 2));
                    Environment.Exit(0);
                }
                if (World.Keyk.CpuID != World.KeykF.CpuID || World.Keyk.IP != World.KeykF.IP || World.Keyk.Mac != World.KeykF.Mac)
                {
                    //Form1.WriteLine(100, "没有注册 注册号3:" + Key2);
                    //Form1.WriteLine(100, "2" + Hasher.GetDriveID("C") + "|" + World.pWord(kk[1], 2));
                    Environment.Exit(0);
                }
                else if (World.KeykF.IP.Length < 4 || World.KeykF.Mac.Length < 4 || World.Keyk.IP.Length < 4 || World.Keyk.Mac.Length < 4)
                {
                    //Form1.WriteLine(100, "没有注册 注册号4:" + Key2);
                    //Form1.WriteLine(100, "3" + Hasher.GetDriveID("C") + "|" + World.pWord(kk[1], 2));
                    Environment.Exit(0);
                }
                //return 0;
            }
            catch (Exception exception1)
            {
                //Form1.WriteLine(1, "系统错误:" + exception1.Message);
                //Form1.WriteLine(100, "11" + exception1.Message);
                Environment.Exit(0);
            }
        }

        public static bool 检查数据库配置()
        {
            using (SqlConnection sqlConnection = new SqlConnection(DBA.getstrConnection("rxjhaccount")))
            {
                try
                {
                    sqlConnection.Open();
                }
                catch
                {
                    Form1.WriteLine(1, "数据库rxjhaccount配置错误，无法连接");
                    bool result = false;
                    return result;
                }
                finally
                {
                    sqlConnection.Close();
                }
            }
            using (SqlConnection sqlConnection2 = new SqlConnection(DBA.getstrConnection("GameServer")))
            {
                try
                {
                    sqlConnection2.Open();
                }
                catch
                {
                    Form1.WriteLine(1, "数据库rxjhgame配置错误，无法连接");
                    bool result = false;
                    return result;
                }
                finally
                {
                    sqlConnection2.Close();
                }
            }
            using (SqlConnection sqlConnection3 = new SqlConnection(DBA.getstrConnection("PublicDb")))
            {
                try
                {
                    sqlConnection3.Open();
                }
                catch
                {
                    Form1.WriteLine(1, "数据库PublicDb配置错误，无法连接");
                    bool result = false;
                    return result;
                }
                finally
                {
                    sqlConnection3.Close();
                }
            }
            return true;
        }

        public void SetConfig2()
        {
            DbClass dbClass = new DbClass();
            dbClass.ServerDb = "rxjhaccount";
            dbClass.SqlConnect = string.Format("Data Source={0};uid={1};pwd={2};database={3};Packet Size=4096;Pooling=true;Max Pool Size=512;Min Pool Size=1", new object[]
            {
                Config.IniReadValue("rxjhaccount", "Server").Trim(),
                Config.IniReadValue("rxjhaccount", "UserName").Trim(),
                Config.IniReadValue("rxjhaccount", "PassWord").Trim(),
                Config.IniReadValue("rxjhaccount", "DataName").Trim()
            });
            World.Db.Add("rxjhaccount", dbClass);
            dbClass = new DbClass();
            dbClass.ServerDb = "GameServer";
            dbClass.SqlConnect = string.Format("Data Source={0};uid={1};pwd={2};database={3};Packet Size=4096;Pooling=true;Max Pool Size=512;Min Pool Size=1", new object[]
            {
                Config.IniReadValue("GameServer", "Server").Trim(),
                Config.IniReadValue("GameServer", "UserName").Trim(),
                Config.IniReadValue("GameServer", "PassWord").Trim(),
                Config.IniReadValue("GameServer", "DataName").Trim()
            });
            World.Db.Add("GameServer", dbClass);
            dbClass = new DbClass();
            dbClass.ServerDb = "PublicDb";
            dbClass.SqlConnect = string.Format("Data Source={0};uid={1};pwd={2};database={3};Packet Size=4096;Pooling=true;Max Pool Size=512;Min Pool Size=1", new object[]
            {
                Config.IniReadValue("PublicDb", "Server").Trim(),
                Config.IniReadValue("PublicDb", "UserName").Trim(),
                Config.IniReadValue("PublicDb", "PassWord").Trim(),
                Config.IniReadValue("PublicDb", "DataName").Trim()
            });
            World.Db.Add("PublicDb", dbClass);
            dbClass = new DbClass();
            dbClass.ServerDb = "bbgDb";
            dbClass.SqlConnect = string.Format("Data Source={0};uid={1};pwd={2};database={3};Packet Size=4096;Pooling=true;Max Pool Size=512;Min Pool Size=1", new object[]
            {
                Config.IniReadValue("bbgDb", "Server").Trim(),
                Config.IniReadValue("bbgDb", "UserName").Trim(),
                Config.IniReadValue("bbgDb", "PassWord").Trim(),
                Config.IniReadValue("bbgDb", "DataName").Trim()
            });
            World.Db.Add("bbgDb", dbClass);
            if (World.查非法物品 == 2)
            {
                dbClass = new DbClass();
                dbClass.ServerDb = "WebDb";
                dbClass.SqlConnect = string.Format("Data Source={0};uid={1};pwd={2};database={3};Packet Size=4096;Pooling=true;Max Pool Size=512;Min Pool Size=1", new object[]
                {
                    Config.IniReadValue("WebDb", "Server").Trim(),
                    Config.IniReadValue("WebDb", "UserName").Trim(),
                    Config.IniReadValue("WebDb", "PassWord").Trim(),
                    Config.IniReadValue("WebDb", "DataName").Trim()
                });
                World.Db.Add("WebDb", dbClass);
            }
        }

        public static bool 检查物品是否被锁定(int pid)
        {
            return World.锁定物品列表.Contains(pid);
        }

        public void Set冲关地图()
        {
            try
            {
                World.冲关地图list.Clear();
                string[] array = World.冲关地图.Split(new char[]
                {
                    ';'
                });
                if (array.Length > 1)
                {
                    for (int i = 0; i < array.Length; i++)
                    {
                        string[] array2 = array[i].Split(new char[]
                        {
                            ','
                        });
                        if (array2.Length > 3 && !World.冲关地图list.ContainsKey(array2[0]))
                        {
                            冲关地图类 冲关地图类 = new 冲关地图类();
                            冲关地图类.地图名 = array2[0];
                            冲关地图类.地图ID = int.Parse(array2[1]);
                            冲关地图类.ItmeID = int.Parse(array2[2]);
                            冲关地图类.进入时间 = int.Parse(array2[3]);
                            World.冲关地图list.Add(冲关地图类.地图名, 冲关地图类);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Form1.WriteLine(2, "加载冲关地图出错---" + ex.Message);
            }
        }

        public void Set异口同声()
        {
        }
        public void Set人物数据()
        {
            DataTable dBToDataTable = DBA.GetDBToDataTable(string.Format("select * from TBL_ACCOUNT"), "rxjhaccount");
            if (dBToDataTable == null)
            {
                return;
            }
            if (dBToDataTable.Rows.Count == 0)
            {
                Form1.WriteLine(2, "加载人物数据出错----没有检查数据");
            }
            else
            {
                账号人物名list.Clear();
                for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                {
                    账号人物名 人物 = new 账号人物名();
                    人物.UserId = dBToDataTable.Rows[i]["FLD_ID"].ToString();
                    人物.UserName = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                    账号人物名list.Add(人物.UserId, 人物);
                }
                Form1.WriteLine(2, "加载人物数据完成" + dBToDataTable.Rows.Count);
            }
            dBToDataTable.Dispose();
        }
        public void get提现公告()
        {

            DataTable dBToDataTable = DBA.GetDBToDataTable(string.Format("select * from cash where id >" + 已提现), "rxjhaccount");
            if (dBToDataTable == null)
            {
                return;
            }
            if (dBToDataTable.Rows.Count == 0)
            {
                return;
            }
            else
            {
                for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                {
                    已提现 = (int)dBToDataTable.Rows[i]["Id"];
                    发送公告("玩家【" + dBToDataTable.Rows[i]["GameName"].ToString() + "】提现元宝【" + dBToDataTable.Rows[i]["PushIngots"].ToString() + "】获得【" + dBToDataTable.Rows[i]["Je"].ToString() + "】RMB");
                }
            }
            dBToDataTable.Dispose();
        }

        public void get邀请公告()
        {
            DataTable dBToDataTable = DBA.GetDBToDataTable(string.Format("select * from binds where id >" + 已邀请), "rxjhaccount");
            if (dBToDataTable == null)
            {
                return;
            }
            if (dBToDataTable.Rows.Count == 0)
            {
                return;
            }
            else
            {
                for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                {
                    string name = "";
                    账号人物名 value;
                    if (World.账号人物名list.TryGetValue(dBToDataTable.Rows[i]["otherid"].ToString(), out value))
                    {
                        name = value.UserName;
                   
                    }


                    发送公告("恭喜玩家【" + name + "】成功邀请【" + dBToDataTable.Rows[i]["rname"].ToString() + "】玩家");
                    已邀请 = (int)dBToDataTable.Rows[i]["Id"];
                }
            }
            dBToDataTable.Dispose();
        }
        public void Set任务物品()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_任务物品", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载任务物品数据出错----没有检查数据");
                }
                else
                {
                    World.任务需要物品list.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        任务需要物品 任务需要物品 = new 任务需要物品();
                        任务需要物品.任务物品 = (int)dBToDataTable.Rows[i]["任务物品"];
                        任务需要物品.需要数量 = (int)dBToDataTable.Rows[i]["需要数量"];
                        任务需要物品.任务ID = (int)dBToDataTable.Rows[i]["任务ID"];
                        任务需要物品.任务阶段 = (int)dBToDataTable.Rows[i]["任务阶段"];
                        World.任务需要物品list.Add(任务需要物品.任务物品, 任务需要物品);
                    }
                    Form1.WriteLine(2, "加载任务物品数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetBossInfo()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_BOSS设置", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载BOSS设置数据出错----没有检查数据");
                }
                else
                {
                    World.BOSS设置list.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        BOSS地图 bOSS地图 = new BOSS地图();
                        bOSS地图.ID = (int)dBToDataTable.Rows[i]["ID"];
                        bOSS地图.地图ID = (int)dBToDataTable.Rows[i]["FLD_MID"];
                        bOSS地图.地图名字 = dBToDataTable.Rows[i]["FLD_MINAME"].ToString();
                        bOSS地图.怪物ID = (int)dBToDataTable.Rows[i]["FLD_BOSSID"];
                        bOSS地图.怪物名字 = dBToDataTable.Rows[i]["FLD_BOSSNAME"].ToString();
                        bOSS地图.携带物品ID = (int)dBToDataTable.Rows[i]["FLD_DROPID"];
                        bOSS地图.携带物品名字 = dBToDataTable.Rows[i]["FLD_DROPNAME"].ToString();
                        bOSS地图.出现时间 = (int)dBToDataTable.Rows[i]["FLD_TIME"];
                        bOSS地图.坐标X = (int)dBToDataTable.Rows[i]["FLD_X"];
                        bOSS地图.坐标Y = (int)dBToDataTable.Rows[i]["FLD_Y"];
                        bOSS地图.是否可以进入 = false;
                        World.BOSS设置list.Add(bOSS地图.ID, bOSS地图);
                    }
                    Form1.WriteLine(2, "加载BOSS地图怪物设置完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void Set转职属性()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_转职属性", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载转职属性数据出错----没有转职属性数据");
                }
                else
                {
                    World.转职属性.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        转职属性类 转职属性类 = new 转职属性类();
                        转职属性类.转职等级 = (int)dBToDataTable.Rows[i]["FLD_转职等级"];
                        转职属性类.增加攻击 = (int)dBToDataTable.Rows[i]["FLD_增加攻击"];
                        转职属性类.增加防御 = (int)dBToDataTable.Rows[i]["FLD_增加防御"];
                        转职属性类.增加MP = (int)dBToDataTable.Rows[i]["FLD_增加魔法"];
                        转职属性类.增加HP = (int)dBToDataTable.Rows[i]["FLD_增加生命"];
                        World.转职属性.Add(转职属性类);
                    }
                    Form1.WriteLine(2, "加载转职属性数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void Set任务传书数据()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_任务系统", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载任务传书数据出错----没有任务传书数据");
                }
                else
                {
                    World.任务公告list.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        任务系统 任务系统 = new 任务系统();
                        任务系统.任务ID = (int)dBToDataTable.Rows[i]["任务ID"];
                        任务系统.任务NPC = (int)dBToDataTable.Rows[i]["任务正邪"];
                        任务系统.任务等级 = (int)dBToDataTable.Rows[i]["任务等级"];
                        任务系统.NPC名字 = dBToDataTable.Rows[i]["NPC名字"].ToString();
                        任务系统.任务传书内容 = dBToDataTable.Rows[i]["任务传书"].ToString();
                        World.任务公告list.Add(任务系统.任务ID, 任务系统);
                    }
                    Form1.WriteLine(2, "加载任务传书数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }
        public void SetDB首爆()
        {
            DataTable dBToDataTable = DBA.GetDBToDataTable(string.Format("SELECT * FROM 首爆礼"), "GameServer");
            if (dBToDataTable == null)
            {
                return;
            }
            if (dBToDataTable.Rows.Count == 0)
            {
                Form1.WriteLine(2, "加载首爆礼数据完成----没有首爆礼数据");
            }
            else
            {
                Set首爆.Clear();
                for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                {
                    try
                    {
                        首爆 monSterClss = new 首爆();
                        monSterClss.FLD_NAME1 = (int)dBToDataTable.Rows[i]["物品id"];
                        monSterClss.FLD_YB1 = (int)dBToDataTable.Rows[i]["yb1"];
                        monSterClss.FLD_YB2 = (int)dBToDataTable.Rows[i]["yb2"];
                        monSterClss.FLD_YB3 = (int)dBToDataTable.Rows[i]["yb3"];
                        monSterClss.FLD_YB4 = (int)dBToDataTable.Rows[i]["yb4"];
                        monSterClss.FLD_YB5 = (int)dBToDataTable.Rows[i]["yb5"];
                        Set首爆.Add(monSterClss);
                    }
                    catch (Exception ex)
                    {
                        Form1.WriteLine(1, "加载首爆礼数据 出错：" + ((ex != null) ? ex.ToString() : null));
                    }
                }
                Form1.WriteLine(2, "加载首爆礼数据完成 " + dBToDataTable.Rows.Count);
            }
            dBToDataTable.Dispose();
        }

        public void Set百宝物品()
        {
            string sqlCommand = string.Format("SELECT * FROM ITEMSELL ORDER BY id", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "bbgDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载百宝阁物品出错----没有移动数据");
                }
                else
                {
                    int num = 0;
                    World.百宝阁物品.Clear();
                    try
                    {
                        for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                        {
                            bbg物品类 bbg物品类 = new bbg物品类();
                            bbg物品类.物品ID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                            bbg物品类.物品价格 = (int)dBToDataTable.Rows[i]["FLD_PRICE"];
                            bbg物品类.物品类型 = (int)dBToDataTable.Rows[i]["FLD_TYPE"];
                            bbg物品类.返还积分 = (int)dBToDataTable.Rows[i]["FLD_RETURN"];
                            bbg物品类.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                            bbg物品类.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                            bbg物品类.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                            bbg物品类.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                            bbg物品类.FLD_MAGIC5 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                            bbg物品类.FLD_JF = (int)dBToDataTable.Rows[i]["FLD_JF"];
                            bbg物品类.FLD_绑定 = ((int)dBToDataTable.Rows[i]["FLD_绑定"] != 0);
                            num = bbg物品类.物品ID;
                            World.百宝阁物品.Add((int)dBToDataTable.Rows[i]["FLD_PID"], bbg物品类);
                        }
                    }
                    catch (Exception ex)
                    {
                        Form1.WriteLine(1, "加载百宝阁物品" + num.ToString() + "出错 错误" + ex.Message);
                    }
                    Form1.WriteLine(2, "加载百宝阁物品数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void set会员装备()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_会员装备", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载会员装备出错----没有数据");
                }
                else
                {
                    World.会员物品.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        会员装备类 会员装备类 = new 会员装备类();
                        会员装备类.物品ID = (int)dBToDataTable.Rows[i]["FLD_ID"];
                        会员装备类.名称 = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                        会员装备类.职业 = (int)dBToDataTable.Rows[i]["FLD_JOB"];
                        会员装备类.物品正邪 = (int)dBToDataTable.Rows[i]["FLD_ZX"];
                        会员装备类.物品性别 = (int)dBToDataTable.Rows[i]["FLD_SEX"];
                        会员装备类.物品类型 = (int)dBToDataTable.Rows[i]["FLD_RESIDE"];
                        会员装备类.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                        会员装备类.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                        会员装备类.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                        会员装备类.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                        会员装备类.FLD_MAGIC5 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                        会员装备类.FLD_绑定 = true;
                        World.会员物品.Add((int)dBToDataTable.Rows[i]["ID"], 会员装备类);
                    }
                }
                dBToDataTable.Dispose();
            }
        }

        public void Set套装物品()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_套装物品", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载套装物品出错----没有套装物品数据");
                }
                else
                {
                    World.套装物品.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        套装物品类 套装物品类 = new 套装物品类();
                        套装物品类.套装类型 = (int)dBToDataTable.Rows[i]["FLD_TYPE"];
                        套装物品类.物品类型 = (int)dBToDataTable.Rows[i]["FLD_RESIDE"];
                        套装物品类.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                        套装物品类.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                        套装物品类.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                        套装物品类.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                        套装物品类.FLD_MAGIC5 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                        套装物品类.FLD_绑定 = true;
                        World.套装物品.Add((int)dBToDataTable.Rows[i]["ID"], 套装物品类);
                    }
                    Form1.WriteLine(2, "加载套装物品数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void Set冲级奖励物品()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_冲级奖品", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载冲级奖励物品出错----没有冲级奖励物品数据");
                }
                else
                {
                    World.冲级奖励物品.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        套装物品类 套装物品类 = new 套装物品类();
                        套装物品类.wpID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                        套装物品类.套装类型 = (int)dBToDataTable.Rows[i]["FLD_LEVEL"];
                        套装物品类.物品类型 = (int)dBToDataTable.Rows[i]["FLD_PID_TYPE"];
                        套装物品类.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                        套装物品类.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                        套装物品类.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                        套装物品类.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                        套装物品类.FLD_MAGIC5 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                        套装物品类.FLD_武勋 = (int)dBToDataTable.Rows[i]["FLD_武勋"];
                        套装物品类.FLD_绑定 = ((int)dBToDataTable.Rows[i]["FLD_绑定"] != 0);

                        World.冲级奖励物品.Add((int)dBToDataTable.Rows[i]["ID"], 套装物品类);
                    }
                    Form1.WriteLine(2, "加载冲级奖励物品数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetKill()
        {
            if (!(World.Keyk.CpuID != World.KeykF.CpuID) && !(World.Keyk.DriveID != World.KeykF.DriveID) && !(World.Keyk.IP != World.KeykF.IP) && !(World.Keyk.Mac != World.KeykF.Mac) && World.KeykF.IP.Length >= 4 && World.KeykF.Mac.Length >= 4 && World.Keyk.IP.Length >= 4)
            {
                int arg_B6_0 = World.Keyk.Mac.Length;
            }
            string sqlCommand = string.Format("SELECT * FROM TBL_屏蔽字符", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载过滤出错----没有屏蔽数据");
                }
                else
                {
                    World.Kill.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        KillClass killClass = new KillClass();
                        killClass.Txt = dBToDataTable.Rows[i]["txt"].ToString();
                        killClass.Sffh = (int)dBToDataTable.Rows[i]["sffh"];
                        World.Kill.Add(killClass);
                    }
                    Form1.WriteLine(2, "加载过滤数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void Set公告()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_自动公告", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载公告出错----没有公告数据");
                }
                else
                {
                    World.公告.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        公告类 公告类 = new 公告类();
                        公告类.msg = dBToDataTable.Rows[i]["txt"].ToString();
                        公告类.type = (int)dBToDataTable.Rows[i]["type"];
                        World.公告.Add(i, 公告类);
                    }
                    Form1.WriteLine(2, "加载公告数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void Set安全区()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_安全区", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载安全区出错----没有数据");
                }
                else
                {
                    World.安全区.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        安全区Class 安全区Class = new 安全区Class();
                        安全区Class.MapID = (int)dBToDataTable.Rows[i]["MAP"];
                        安全区Class.S_MINX = float.Parse(dBToDataTable.Rows[i]["S_MINX"].ToString());
                        安全区Class.S_MINY = float.Parse(dBToDataTable.Rows[i]["S_MINY"].ToString());
                        安全区Class.S_MAXX = float.Parse(dBToDataTable.Rows[i]["S_MAXX"].ToString());
                        安全区Class.S_MAXY = float.Parse(dBToDataTable.Rows[i]["S_MAXY"].ToString());
                        World.安全区.Add(安全区Class.MapID, 安全区Class);
                    }
                    Form1.WriteLine(2, "加载安全区数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
            //string[] dt = World.宣战区地图坐标.Split(',');
            坐标Class 坐标Class4 = new 坐标Class();
            坐标Class4.Rxjh_name = "宣战区";
            坐标Class4.Rxjh_Map = int.Parse(World.dt[0]);
            坐标Class4.Rxjh_X = float.Parse(World.dt[1]);
            坐标Class4.Rxjh_Y = float.Parse(World.dt[2]);
            坐标Class4.Rxjh_Z = 15f;
            World.对练区.Add(坐标Class4);
            坐标Class 坐标Class5 = new 坐标Class();
            坐标Class5.Rxjh_name = "复仇区";
            坐标Class5.Rxjh_Map = int.Parse(World.fc[0]);
            坐标Class5.Rxjh_X = float.Parse(World.fc[1]);
            坐标Class5.Rxjh_Y = float.Parse(World.fc[2]);
            坐标Class5.Rxjh_Z = 15f;
            World.复仇区.Add(坐标Class5);
        }

        public void Set移动()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_地图列表 WHERE (X IS NOT NULL)", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载自定义移动出错----没有移动数据");
                }
                else
                {
                    World.移动.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        坐标Class 坐标Class = new 坐标Class();
                        坐标Class.Rxjh_name = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                        坐标Class.Rxjh_Map = (int)dBToDataTable.Rows[i]["FLD_MID"];
                        坐标Class.Rxjh_X = float.Parse(dBToDataTable.Rows[i]["X"].ToString());
                        坐标Class.Rxjh_Y = float.Parse(dBToDataTable.Rows[i]["Y"].ToString());
                        坐标Class.Rxjh_Z = 15f;
                        World.移动.Add(坐标Class);
                    }
                    Form1.WriteLine(2, "加载地图数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public static string[] RanString = new string[]//可能是PK便名字引用
		{
            "~",
            "/",
            "@",
            "#",
            "$",
            "%",
            "^",
            "&",
            "*",
            "|",
            "<",
            ">",
            ":",
            "`"
        };


        public void SetLever()
        {
            World.lever.Clear();
            for (int i = 0; i < 256; i++)
            {
                if (i == 0)
                {
                    World.lever.Add(0, 100.0);
                }
                else if (i <= 10)
                {
                    World.lever.Add(i, World.lever[i - 1] * 1.5);
                }
                else if (i <= 35)
                {
                    World.lever.Add(i, World.lever[i - 1] * 1.4);
                }
                else if (i <= 60)
                {
                    World.lever.Add(i, World.lever[i - 1] + (World.lever[i - 1] - World.lever[i - 2]) * 1.2);
                }
                else if (i <= 80)
                {
                    World.lever.Add(i, World.lever[i - 1] + (World.lever[i - 1] - World.lever[i - 2]) * 1.11);
                }
                else if (i <= 100)
                {
                    World.lever.Add(i, World.lever[i - 1] + (World.lever[i - 1] - World.lever[i - 2]) * 1.06);
                }
                else
                {
                    World.lever.Add(i, World.lever[i - 1] + (World.lever[i - 1] - World.lever[i - 2]) * 1.02);
                }
            }
        }

        public void SetPatLever()
        {
            World.Patlever.Clear();
            for (int i = 0; i < 256; i++)
            {
                if (i == 0)
                {
                    World.Patlever.Add(0, 80.0);
                }
                else if (i < 10)
                {
                    World.Patlever.Add(i, World.Patlever[i - 1] * 1.5);
                }
                else if (i < 35)
                {
                    World.Patlever.Add(i, World.Patlever[i - 1] * 1.3);
                }
                else if (i < 60)
                {
                    World.Patlever.Add(i, World.Patlever[i - 1] * 1.2);
                }
                else if (i < 80)
                {
                    World.Patlever.Add(i, World.Patlever[i - 1] * 1.12);
                }
                else if (i < 100)
                {
                    World.Patlever.Add(i, World.Patlever[i - 1] * 1.1);
                }
                else
                {
                    World.Patlever.Add(i, World.Patlever[i - 1] * 1.07);
                }
            }
        }

        public void SetWxLever()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_武勋加成", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载武勋列表出错----没有武勋数据");
                }
                else
                {
                    World.Wxlever.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        武勋加成类 武勋加成类 = new 武勋加成类();
                        武勋加成类.武勋等级 = (int)dBToDataTable.Rows[i]["FLD_武勋等级"];
                        武勋加成类.武勋点 = double.Parse(dBToDataTable.Rows[i]["FLD_武勋点"].ToString());
                        武勋加成类.增加攻击 = (int)dBToDataTable.Rows[i]["FLD_攻击加成"];
                        武勋加成类.增加防御 = (int)dBToDataTable.Rows[i]["FLD_防御加成"];
                        武勋加成类.增加HP = (int)dBToDataTable.Rows[i]["FLD_生命加成"];
                        武勋加成类.增加MP = (int)dBToDataTable.Rows[i]["FLD_内功加成"];
                        武勋加成类.增加气功 = (int)dBToDataTable.Rows[i]["FLD_气功加成"];
                        World.Wxlever.Add((int)dBToDataTable.Rows[i]["ID"], 武勋加成类);
                    }
                }
                dBToDataTable.Dispose();
            }
            Form1.WriteLine(2, "加载武勋阶段表完成");
        }

        public void SetMover()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_移动数据", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载移动出错----没有移动数据");
                }
                else
                {
                    World.Mover.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        MoveClass moveClass = new MoveClass();
                        moveClass.MAP = (int)dBToDataTable.Rows[i]["MAP"];
                        moveClass.X = float.Parse(dBToDataTable.Rows[i]["X"].ToString());
                        moveClass.Y = float.Parse(dBToDataTable.Rows[i]["Y"].ToString());
                        moveClass.Z = float.Parse(dBToDataTable.Rows[i]["Z"].ToString());
                        moveClass.ToMAP = (int)dBToDataTable.Rows[i]["ToMAP"];
                        moveClass.ToX = float.Parse(dBToDataTable.Rows[i]["ToX"].ToString());
                        moveClass.ToY = float.Parse(dBToDataTable.Rows[i]["ToY"].ToString());
                        moveClass.ToZ = float.Parse(dBToDataTable.Rows[i]["ToZ"].ToString());
                        World.Mover.Add(moveClass);
                    }
                    Form1.WriteLine(2, "加载传送点数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetKONGFU()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_功夫数据", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载武功出错----没有武功数据");
                }
                else
                {
                    World.TBL_KONGFU.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        武功类 武功类 = new 武功类();
                        武功类.FLD_AT = (int)dBToDataTable.Rows[i]["FLD_AT"];
                        武功类.FLD_EFFERT = (int)dBToDataTable.Rows[i]["FLD_EFFERT"];
                        武功类.FLD_INDEX = (int)dBToDataTable.Rows[i]["FLD_INDEX"];
                        武功类.FLD_JOB = (int)dBToDataTable.Rows[i]["FLD_JOB"];
                        武功类.FLD_JOBLEVEL = (int)dBToDataTable.Rows[i]["FLD_JOBLEVEL"];
                        武功类.FLD_LEVEL = (int)dBToDataTable.Rows[i]["FLD_LEVEL"];
                        武功类.FLD_MP = (int)dBToDataTable.Rows[i]["FLD_MP"];
                        武功类.FLD_NEEDEXP = (int)dBToDataTable.Rows[i]["FLD_NEEDEXP"];
                        武功类.FLD_PID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                        武功类.FLD_TYPE = (int)dBToDataTable.Rows[i]["FLD_TYPE"];
                        武功类.FLD_ZX = (int)dBToDataTable.Rows[i]["FLD_ZX"];
                        武功类.FLD_阶段数量 = (int)dBToDataTable.Rows[i]["FLD_阶段数量"];
                        武功类.FLD_攻击数量 = (int)dBToDataTable.Rows[i]["FLD_攻击数量"];
                        武功类.FLD_武功类型 = (int)dBToDataTable.Rows[i]["FLD_武功类型"];
                        武功类.FLD_冷却时间 = (int)dBToDataTable.Rows[i]["FLD_冷却时间"];
                        武功类.FLD_攻击确认时间 = (int)dBToDataTable.Rows[i]["FLD_攻击确认时间"];
                        World.TBL_KONGFU.Add(武功类.FLD_PID, 武功类);
                    }
                    Form1.WriteLine(2, "加载武功数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetItme()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_物品列表", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载物品出错----没有物品数据");
                }
                else
                {
                    World.Itme.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        ItmeClass itmeClass = new ItmeClass();
                        itmeClass.FLD_NJ = (int)dBToDataTable.Rows[i]["FLD_NJ"];
                        itmeClass.FLD_AT = (int)dBToDataTable.Rows[i]["FLD_AT1"];
                        itmeClass.FLD_AT_Max = (int)dBToDataTable.Rows[i]["FLD_AT2"];
                        itmeClass.FLD_DF = (int)dBToDataTable.Rows[i]["FLD_DF"];
                        itmeClass.FLD_RESIDE1 = (int)dBToDataTable.Rows[i]["FLD_RESIDE1"];
                        itmeClass.FLD_RESIDE2 = (int)dBToDataTable.Rows[i]["FLD_RESIDE2"];
                        itmeClass.FLD_JOB_LEVEL = (int)dBToDataTable.Rows[i]["FLD_JOB_LEVEL"];
                        itmeClass.FLD_LEVEL = (int)dBToDataTable.Rows[i]["FLD_LEVEL"];
                        itmeClass.FLD_MONEY = (int)dBToDataTable.Rows[i]["FLD_MONEY"];
                        itmeClass.FLD_PID = int.Parse(dBToDataTable.Rows[i]["FLD_PID"].ToString());
                        itmeClass.FLD_SEX = (int)dBToDataTable.Rows[i]["FLD_SEX"];
                        itmeClass.FLD_WEIGHT = (int)dBToDataTable.Rows[i]["FLD_WEIGHT"];
                        itmeClass.FLD_ZX = (int)dBToDataTable.Rows[i]["FLD_ZX"];
                        itmeClass.FLD_SIDE = (int)dBToDataTable.Rows[i]["FLD_SIDE"];
                        itmeClass.FLD_MAGIC0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                        itmeClass.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                        itmeClass.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                        itmeClass.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                        itmeClass.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC5"];
                        itmeClass.FLD_XW = (int)dBToDataTable.Rows[i]["FLD_WX"];
                        itmeClass.FLD_XWJD = (int)dBToDataTable.Rows[i]["FLD_WXJD"];
                        itmeClass.FLD_TYPE = (int)dBToDataTable.Rows[i]["FLD_TYPE"];
                        itmeClass.FLD_QUESTITEM = (int)dBToDataTable.Rows[i]["FLD_QUESTITEM"];
                        itmeClass.FLD_HEAD_WEAR = (int)dBToDataTable.Rows[i]["FLD_HEAD_WEAR"];
                        itmeClass.ItmeNAME = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                        itmeClass.FLD_JF = (int)dBToDataTable.Rows[i]["FLD_JF"];
                        itmeClass.FLD_LOCK = (int)dBToDataTable.Rows[i]["FLD_LOCK"];
                        World.Itme.Add(itmeClass.FLD_PID, itmeClass);
                    }
                    Form1.WriteLine(2, "加载物品数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetShot()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_商店物品 ORDER BY FLD_INDEX", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载物品商店----没有物品数据");
                }
                else
                {
                    World.Shot.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        ShotClass shotClass = new ShotClass();
                        shotClass.FLD_NID = int.Parse(dBToDataTable.Rows[i]["FLD_NID"].ToString());
                        shotClass.FLD_INDEX = (int)dBToDataTable.Rows[i]["FLD_INDEX"];
                        shotClass.FLD_PID = int.Parse(dBToDataTable.Rows[i]["FLD_PID"].ToString());
                        shotClass.FLD_MAGIC0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                        shotClass.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                        shotClass.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                        shotClass.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                        shotClass.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                        shotClass.WX = (int)dBToDataTable.Rows[i]["FLD_WX"];
                        shotClass.NEEDWX = (int)dBToDataTable.Rows[i]["FLD_NEEDWX"];
                        World.Shot.Add(shotClass);
                    }
                    Form1.WriteLine(2, "加载物品商店完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetDrop()
        {
            try
            {
                string sqlCommand = string.Format("SELECT * FROM TBL_掉落_普通怪 ORDER BY FLD_LEVEL1, FLD_LEVEL2", new object[0]);
                DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
                if (dBToDataTable != null)
                {
                    if (dBToDataTable.Rows.Count == 0)
                    {
                        Form1.WriteLine(2, "加载掉落物品完成----没有物品数据");
                    }
                    else
                    {
                        World.Drop.Clear();
                        for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                        {
                            DropClass dropClass = new DropClass();
                            try
                            {
                                dropClass.FLD_NPC = (int)dBToDataTable.Rows[i]["FLD_掉落怪物ID"];
                                dropClass.FLD_LEVEL1 = (int)dBToDataTable.Rows[i]["FLD_LEVEL1"];
                                dropClass.FLD_LEVEL2 = (int)dBToDataTable.Rows[i]["FLD_LEVEL2"];
                                dropClass.FLD_PID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                                dropClass.FLD_PP = (int)dBToDataTable.Rows[i]["FLD_PP"];
                                dropClass.FLD_NAME = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                                dropClass.FLD_MAGIC0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                                dropClass.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                                dropClass.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                                dropClass.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                                dropClass.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                                dropClass.FLD_MAGICNew0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                                dropClass.FLD_MAGICNew1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                                dropClass.FLD_MAGICNew2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                                dropClass.FLD_MAGICNew3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                                dropClass.FLD_MAGICNew4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                                dropClass.是否提示 = (int)dBToDataTable.Rows[i]["是否提示"];
                                dropClass.需要金符 = (int)dBToDataTable.Rows[i]["需要金符"];
                                World.Drop.Add(dropClass);
                            }
                            catch (Exception ex)
                            {
                                Form1.WriteLine(1, "加载掉落物品 错误" + dropClass.FLD_NAME + "  " + ex.Message);
                            }
                        }
                        Form1.WriteLine(2, "加载掉落物品 " + dBToDataTable.Rows.Count);
                    }
                    dBToDataTable.Dispose();
                }
            }
            catch (Exception ex2)
            {
                Form1.WriteLine(1, "加载掉落物品 错误" + ex2.Message);
            }
        }

        public void Set_GSDrop()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_掉落_高手怪 ORDER BY FLD_LEVEL1, FLD_LEVEL2", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载高手怪掉落物品完成----没有物品数据");
                }
                else
                {
                    World.Drop_GS.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        DropClass dropClass = new DropClass();
                        try
                        {
                            dropClass.FLD_NPC = (int)dBToDataTable.Rows[i]["FLD_掉落怪物ID"];
                            dropClass.FLD_LEVEL1 = (int)dBToDataTable.Rows[i]["FLD_LEVEL1"];
                            dropClass.FLD_LEVEL2 = (int)dBToDataTable.Rows[i]["FLD_LEVEL2"];
                            dropClass.FLD_PID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                            dropClass.FLD_PP = (int)dBToDataTable.Rows[i]["FLD_PP"];
                            dropClass.FLD_NAME = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                            dropClass.FLD_MAGIC0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                            dropClass.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                            dropClass.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                            dropClass.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                            dropClass.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                            dropClass.FLD_MAGICNew0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                            dropClass.FLD_MAGICNew1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                            dropClass.FLD_MAGICNew2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                            dropClass.FLD_MAGICNew3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                            dropClass.FLD_MAGICNew4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                            dropClass.是否提示 = (int)dBToDataTable.Rows[i]["是否提示"];
                            World.Drop_GS.Add(dropClass);
                        }
                        catch (Exception ex)
                        {
                            Form1.WriteLine(1, "加载掉落物品 错误" + dropClass.FLD_NAME + "  " + ex.Message);
                        }
                    }
                    Form1.WriteLine(2, "加载高手怪落物品 " + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetBossDrop()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_掉落_BOSS ORDER BY FLD_LEVEL1, FLD_LEVEL2", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载BOSS掉落物品完成----没有物品数据");
                }
                else
                {
                    World.BossDrop.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        DropClass dropClass = new DropClass();
                        try
                        {
                            dropClass.FLD_NPC = (int)dBToDataTable.Rows[i]["FLD_掉落怪物ID"];
                            dropClass.FLD_LEVEL1 = (int)dBToDataTable.Rows[i]["FLD_LEVEL1"];
                            dropClass.FLD_LEVEL2 = (int)dBToDataTable.Rows[i]["FLD_LEVEL2"];
                            dropClass.FLD_PID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                            dropClass.FLD_PP = (int)dBToDataTable.Rows[i]["FLD_PP"];
                            dropClass.FLD_NAME = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                            dropClass.FLD_MAGIC0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                            dropClass.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                            dropClass.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                            dropClass.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                            dropClass.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                            dropClass.FLD_MAGICNew0 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                            dropClass.FLD_MAGICNew1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                            dropClass.FLD_MAGICNew2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                            dropClass.FLD_MAGICNew3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                            dropClass.FLD_MAGICNew4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                            dropClass.是否提示 = (int)dBToDataTable.Rows[i]["是否提示"];
                            World.BossDrop.Add(dropClass);
                        }
                        catch (Exception ex)
                        {
                            Form1.WriteLine(1, "加载掉落物品 错误" + dropClass.FLD_NAME + "  " + ex.Message);
                        }
                    }
                    Form1.WriteLine(2, "加载BOSS掉落物品 " + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetOpen()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_开箱数据", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载开箱物品完成----没有开箱物品数据");
                }
                else
                {
                    World.Open.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        OpenClass openClass = new OpenClass();
                        openClass.FLD_PID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                        openClass.FLD_PIDX = (int)dBToDataTable.Rows[i]["FLD_PIDX"];
                        openClass.FLD_NUMBER = (int)dBToDataTable.Rows[i]["FLD_NUMBER"];
                        openClass.FLD_PP = (int)dBToDataTable.Rows[i]["FLD_PP"];
                        openClass.FLD_NAME = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                        openClass.FLD_NAMEX = dBToDataTable.Rows[i]["FLD_NAMEX"].ToString();
                        openClass.FLD_MAGIC1 = (int)dBToDataTable.Rows[i]["FLD_MAGIC0"];
                        openClass.FLD_MAGIC2 = (int)dBToDataTable.Rows[i]["FLD_MAGIC1"];
                        openClass.FLD_MAGIC3 = (int)dBToDataTable.Rows[i]["FLD_MAGIC2"];
                        openClass.FLD_MAGIC4 = (int)dBToDataTable.Rows[i]["FLD_MAGIC3"];
                        openClass.FLD_MAGIC5 = (int)dBToDataTable.Rows[i]["FLD_MAGIC4"];
                        openClass.是否提示 = (int)dBToDataTable.Rows[i]["是否提示"];
                        World.Open.Add(openClass);
                    }
                    Form1.WriteLine(2, "加载开箱物品 " + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetDBConfig()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_配置数据", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载数据库配置数据----没有数据");
                }
                else
                {
                    Form1.WriteLine(2, "加载配置数据完成 " + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public void SetMonSter()
        {
            string sqlCommand = string.Format("SELECT * FROM TBL_NPC列表", new object[0]);
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载怪物数据完成----没有怪物数据");
                }
                else
                {
                    World.MonSter.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        try
                        {
                            MonSterClss monSterClss = new MonSterClss();
                            monSterClss.FLD_PID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                            monSterClss.FLD_AT = (double)((int)dBToDataTable.Rows[i]["FLD_AT"]);
                            monSterClss.FLD_AUTO = (int)dBToDataTable.Rows[i]["FLD_AUTO"];
                            monSterClss.FLD_BOSS = (int)dBToDataTable.Rows[i]["FLD_BOSS"];
                            monSterClss.FLD_DF = (double)((int)dBToDataTable.Rows[i]["FLD_DF"]);
                            monSterClss.Level = (int)dBToDataTable.Rows[i]["FLD_LEVEL"];
                            monSterClss.Name = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                            monSterClss.Rxjh_Exp = (int)dBToDataTable.Rows[i]["FLD_EXP"];
                            monSterClss.Rxjh_HP = (int)dBToDataTable.Rows[i]["FLD_HP"];
                            World.MonSter.Add(monSterClss.FLD_PID, monSterClss);
                        }
                        catch (Exception arg)
                        {
                            Form1.WriteLine(1, "加载怪物数据 出错：" + arg);
                        }
                    }
                    Form1.WriteLine(2, "加载怪物数据完成 " + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }
        public void Set石头属性()
        {
            string sql = string.Format("SELECT * FROM 石头属性效果");
            DataTable dBToDataTable = DbClss.DBA.GetDBToDataTable(sql, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载石头数据出错----没有石头数据");
                }
                else
                {
                    World.石头属性调整.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        石头属性调整类 石头 = new 石头属性调整类();
                        石头.类型 = (int)dBToDataTable.Rows[i]["FLD_TYPE"];
                        石头.数量 = (int)dBToDataTable.Rows[i]["FLD_VALUE"];
                        石头.加减 = (int)dBToDataTable.Rows[i]["FLD_增减"];
                        World.石头属性调整.Add(i, 石头);
                    }
                    Form1.WriteLine(2, "加载石头石头数据完成" + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }
        public void SetNpc()
        {
            string sqlCommand;
            if (World.ver == 1)
            {
                sqlCommand = string.Format("SELECT * FROM TBL_怪物列表", new object[0]);
            }
            else
            {
                sqlCommand = string.Format("SELECT * FROM TBL_怪物列表 WHERE FLD_BOSS < 2", new object[0]);
            }
            DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "PublicDb");
            if (dBToDataTable != null)
            {
                if (dBToDataTable.Rows.Count == 0)
                {
                    Form1.WriteLine(2, "加载NPC数据出错----没有NPC数据");
                }
                else
                {
                    World.Map.Clear();
                    for (int i = 0; i < dBToDataTable.Rows.Count; i++)
                    {
                        try
                        {
                            NpcClass npcClass = new NpcClass();
                            npcClass.FLD_PID = (int)dBToDataTable.Rows[i]["FLD_PID"];
                            if (World.当前线路类型 != 1 || npcClass.FLD_PID < 10000)
                            {
                                npcClass.Name = dBToDataTable.Rows[i]["FLD_NAME"].ToString();
                                npcClass.Level = (int)dBToDataTable.Rows[i]["FLD_LEVEL"];
                                npcClass.Rxjh_Exp = (int)dBToDataTable.Rows[i]["FLD_EXP"];
                                npcClass.Rxjh_X = float.Parse(dBToDataTable.Rows[i]["FLD_X"].ToString());
                                npcClass.Rxjh_Y = float.Parse(dBToDataTable.Rows[i]["FLD_Y"].ToString());
                                npcClass.Rxjh_Z = float.Parse(dBToDataTable.Rows[i]["FLD_Z"].ToString());
                                npcClass.Rxjh_cs_X = float.Parse(dBToDataTable.Rows[i]["FLD_X"].ToString());
                                npcClass.Rxjh_cs_Y = float.Parse(dBToDataTable.Rows[i]["FLD_Y"].ToString());
                                npcClass.Rxjh_cs_Z = float.Parse(dBToDataTable.Rows[i]["FLD_Z"].ToString());
                                npcClass.IsNpc = (int)dBToDataTable.Rows[i]["FLD_NPC"];
                                npcClass.FLD_FACE1 = float.Parse(dBToDataTable.Rows[i]["FLD_FACE0"].ToString());
                                npcClass.FLD_FACE2 = float.Parse(dBToDataTable.Rows[i]["FLD_FACE"].ToString());
                                npcClass.Rxjh_Map = (int)dBToDataTable.Rows[i]["FLD_MID"];
                                npcClass.Max_Rxjh_HP = (int)dBToDataTable.Rows[i]["FLD_HP"];
                                npcClass.Rxjh_HP = (int)dBToDataTable.Rows[i]["FLD_HP"];
                                npcClass.FLD_AT = (double)((int)dBToDataTable.Rows[i]["FLD_AT"]);
                                npcClass.FLD_DF = (double)((int)dBToDataTable.Rows[i]["FLD_DF"]);
                                npcClass.FLD_AUTO = (int)dBToDataTable.Rows[i]["FLD_AUTO"];
                                npcClass.FLD_BOSS = (int)dBToDataTable.Rows[i]["FLD_BOSS"];
                                npcClass.FLD_NEWTIME = (int)dBToDataTable.Rows[i]["FLD_NEWTIME"];
                                MapClass mapClass;
                                if (World.Map.TryGetValue(npcClass.Rxjh_Map, out mapClass))
                                {
                                    mapClass.add(npcClass);
                                }
                                else
                                {
                                    mapClass = new MapClass();
                                    mapClass.MapID = npcClass.Rxjh_Map;
                                    mapClass.add(npcClass);
                                    World.Map.Add(mapClass.MapID, mapClass);
                                }
                            }
                        }
                        catch (Exception arg)
                        {
                            Form1.WriteLine(1, "加载NPC数据 出错：" + arg);
                        }
                    }
                    Form1.WriteLine(2, "加载NPC数据完成 " + dBToDataTable.Rows.Count);
                }
                dBToDataTable.Dispose();
            }
        }

        public static void delNpc(int MAP)
        {
            try
            {
                List<NpcClass> list = new List<NpcClass>();
                foreach (NpcClass current in MapClass.GetnpcTemplate(MAP).Values)
                {
                    list.Add(current);
                }
                foreach (NpcClass current2 in list)
                {
                    current2.Dispose();
                }
                list.Clear();
            }
            catch (Exception arg)
            {
                Form1.WriteLine(1, "删除NPC数据 出错：" + arg);
            }
        }

        public static int 统计地图怪物数量(int mapp)
        {
            int result;
            try
            {
                int num = 0;
                foreach (NpcClass arg_1C_0 in MapClass.GetnpcTemplate(mapp).Values)
                {
                    num++;
                }
                result = num;
            }
            catch (Exception ex)
            {
                Form1.WriteLine(2, string.Concat(new object[]
                {
                    "统计地图怪物数量 [",
                    mapp,
                    "]出错：",
                    ex
                }));
                result = 0;
            }
            return result;
        }

        public static void delNpc(int mapp, int Npcid)
        {
            try
            {
                List<NpcClass> list = new List<NpcClass>();
                foreach (NpcClass current in MapClass.GetnpcTemplate(mapp).Values)
                {
                    if (current.FLD_PID == Npcid)
                    {
                        list.Add(current);
                    }
                }
                foreach (NpcClass current2 in list)
                {
                    current2.Dispose();
                }
                list.Clear();
            }
            catch (Exception ex)
            {
                Form1.WriteLine(2, string.Concat(new object[]
                {
                    "删除怪 [",
                    Npcid,
                    "]出错：",
                    ex
                }));
            }
        }

        public static void AddNpc(int Npcid, float x, float y, int mapp)
        {
            try
            {
                MonSterClss monSterClss;
                if (World.MonSter.TryGetValue(Npcid, out monSterClss))
                {
                    NpcClass npcClass = new NpcClass();
                    npcClass.FLD_PID = monSterClss.FLD_PID;
                    npcClass.Name = monSterClss.Name;
                    npcClass.Level = monSterClss.Level;
                    npcClass.Rxjh_Exp = monSterClss.Rxjh_Exp;
                    npcClass.Rxjh_X = x;
                    npcClass.Rxjh_Y = y;
                    npcClass.Rxjh_Z = 15f;
                    npcClass.Rxjh_cs_X = x;
                    npcClass.Rxjh_cs_Y = y;
                    npcClass.Rxjh_cs_Z = 15f;
                    npcClass.Rxjh_Map = mapp;
                    npcClass.IsNpc = 0;
                    npcClass.FLD_FACE1 = 0f;
                    npcClass.FLD_FACE2 = 0f;
                    npcClass.Max_Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.FLD_AT = monSterClss.FLD_AT;
                    npcClass.FLD_DF = monSterClss.FLD_DF;
                    npcClass.FLD_AUTO = monSterClss.FLD_AUTO;
                    npcClass.FLD_BOSS = monSterClss.FLD_BOSS;
                    npcClass.一次性怪 = true;
                    MapClass mapClass;
                    if (World.Map.TryGetValue(npcClass.Rxjh_Map, out mapClass))
                    {
                        mapClass.add(npcClass);
                    }
                    else
                    {
                        mapClass = new MapClass();
                        mapClass.MapID = npcClass.Rxjh_Map;
                        mapClass.add(npcClass);
                        World.Map.Add(mapClass.MapID, mapClass);
                    }
                    npcClass.获取范围玩家发送增加数据包();
                }
            }
            catch (Exception ex)
            {
                Form1.WriteLine(2, string.Concat(new object[]
                {
                    "增加怪 [",
                    Npcid,
                    "]出错：",
                    ex
                }));
            }
        }

        public static void AddNpc(int Npcid, float x, float y, int mapp, int BOSS)
        {
            try
            {
                MonSterClss monSterClss;
                if (World.MonSter.TryGetValue(Npcid, out monSterClss))
                {
                    NpcClass npcClass = new NpcClass();
                    npcClass.FLD_PID = monSterClss.FLD_PID;
                    npcClass.Name = monSterClss.Name;
                    npcClass.Level = monSterClss.Level;
                    npcClass.Rxjh_Exp = monSterClss.Rxjh_Exp;
                    npcClass.Rxjh_X = x;
                    npcClass.Rxjh_Y = y;
                    npcClass.Rxjh_Z = 15f;
                    npcClass.Rxjh_cs_X = x;
                    npcClass.Rxjh_cs_Y = y;
                    npcClass.Rxjh_cs_Z = 15f;
                    npcClass.Rxjh_Map = mapp;
                    npcClass.IsNpc = 0;
                    npcClass.FLD_FACE1 = 0f;
                    npcClass.FLD_FACE2 = 0f;
                    npcClass.Max_Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.FLD_AT = monSterClss.FLD_AT;
                    npcClass.FLD_DF = monSterClss.FLD_DF;
                    npcClass.FLD_AUTO = monSterClss.FLD_AUTO;
                    npcClass.FLD_BOSS = BOSS;
                    npcClass.一次性怪 = true;
                    MapClass mapClass;
                    if (World.Map.TryGetValue(npcClass.Rxjh_Map, out mapClass))
                    {
                        mapClass.add(npcClass);
                    }
                    else
                    {
                        mapClass = new MapClass();
                        mapClass.MapID = npcClass.Rxjh_Map;
                        mapClass.add(npcClass);
                        World.Map.Add(mapClass.MapID, mapClass);
                    }
                    npcClass.获取范围玩家发送增加数据包();
                }
            }
            catch (Exception ex)
            {
                Form1.WriteLine(2, string.Concat(new object[]
                {
                    "增加怪 [",
                    Npcid,
                    "]出错：",
                    ex
                }));
            }
        }

        public static void AddNpc(int Npcid, float x, float y, int mapp, int FLD_FACE1, int FLD_FACE2, bool 一次性怪, int FLD_NEWTIME)
        {
            try
            {
                MonSterClss monSterClss;
                if (World.MonSter.TryGetValue(Npcid, out monSterClss))
                {
                    NpcClass npcClass = new NpcClass();
                    npcClass.FLD_PID = monSterClss.FLD_PID;
                    npcClass.Name = monSterClss.Name;
                    npcClass.Level = monSterClss.Level;
                    npcClass.Rxjh_Exp = monSterClss.Rxjh_Exp;
                    npcClass.Rxjh_X = x;
                    npcClass.Rxjh_Y = y;
                    npcClass.Rxjh_Z = 15f;
                    npcClass.Rxjh_cs_X = x;
                    npcClass.Rxjh_cs_Y = y;
                    npcClass.Rxjh_cs_Z = 15f;
                    npcClass.Rxjh_Map = mapp;
                    npcClass.IsNpc = 0;
                    npcClass.FLD_FACE1 = (float)FLD_FACE1;
                    npcClass.FLD_FACE2 = (float)FLD_FACE2;
                    npcClass.Max_Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.FLD_AT = monSterClss.FLD_AT;
                    npcClass.FLD_DF = monSterClss.FLD_DF;
                    npcClass.FLD_AUTO = monSterClss.FLD_AUTO;
                    npcClass.FLD_BOSS = monSterClss.FLD_BOSS;
                    npcClass.一次性怪 = 一次性怪;
                    npcClass.FLD_NEWTIME = FLD_NEWTIME;
                    MapClass mapClass;
                    if (World.Map.TryGetValue(npcClass.Rxjh_Map, out mapClass))
                    {
                        mapClass.add(npcClass);
                    }
                    else
                    {
                        mapClass = new MapClass();
                        mapClass.MapID = npcClass.Rxjh_Map;
                        mapClass.add(npcClass);
                        World.Map.Add(mapClass.MapID, mapClass);
                    }
                    npcClass.获取范围玩家发送增加数据包();
                }
            }
            catch (Exception ex)
            {
                Form1.WriteLine(2, string.Concat(new object[]
                {
                    "增加怪 [",
                    Npcid,
                    "]出错：",
                    ex
                }));
            }
        }

        public static void SerNpc(int Npcid, float x, float y, int mapp)
        {
            try
            {
                MonSterClss monSterClss;
                if (World.MonSter.TryGetValue(Npcid, out monSterClss))
                {
                    NpcClass npcClass = new NpcClass();
                    npcClass.FLD_PID = monSterClss.FLD_PID;
                    npcClass.Name = monSterClss.Name;
                    npcClass.Level = monSterClss.Level;
                    npcClass.Rxjh_Exp = monSterClss.Rxjh_Exp;
                    npcClass.Rxjh_X = x;
                    npcClass.Rxjh_Y = y;
                    npcClass.Rxjh_Z = 15f;
                    npcClass.Rxjh_cs_X = x;
                    npcClass.Rxjh_cs_Y = y;
                    npcClass.Rxjh_cs_Z = 15f;
                    npcClass.Rxjh_Map = mapp;
                    npcClass.IsNpc = 0;
                    npcClass.FLD_FACE1 = 0f;
                    npcClass.FLD_FACE2 = 0f;
                    npcClass.Max_Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.Rxjh_HP = monSterClss.Rxjh_HP;
                    npcClass.FLD_AT = monSterClss.FLD_AT;
                    npcClass.FLD_DF = monSterClss.FLD_DF;
                    npcClass.FLD_AUTO = monSterClss.FLD_AUTO;
                    npcClass.FLD_BOSS = monSterClss.FLD_BOSS;
                    MapClass mapClass;
                    if (World.Map.TryGetValue(npcClass.Rxjh_Map, out mapClass))
                    {
                        mapClass.add(npcClass);
                    }
                    else
                    {
                        mapClass = new MapClass();
                        mapClass.MapID = npcClass.Rxjh_Map;
                        mapClass.add(npcClass);
                        World.Map.Add(mapClass.MapID, mapClass);
                    }
                    npcClass.获取范围玩家发送增加数据包();
                    string sqlCommand = string.Format("INSERT INTO TBL_怪物列表(FLD_PID,FLD_X,FLD_Y,FLD_Z,FLD_FACE0,FLD_FACE,FLD_MID,FLD_NAME,FLD_HP,FLD_AT,FLD_DF,FLD_NPC,FLD_NEWTIME,FLD_LEVEL,FLD_EXP,FLD_AUTO,FLD_BOSS)VALUES ({0},{1},{2},{3},{4},{5},{6},'{7}',{8},{9},{10},{11},{12},{13},{14},{15},{16})", new object[]
                    {
                        npcClass.FLD_PID,
                        x,
                        y,
                        15,
                        0,
                        0,
                        npcClass.Rxjh_Map,
                        npcClass.Name,
                        npcClass.Max_Rxjh_HP,
                        npcClass.FLD_AT,
                        npcClass.FLD_DF,
                        0,
                        10,
                        npcClass.Level,
                        npcClass.Rxjh_Exp,
                        npcClass.FLD_AUTO,
                        npcClass.FLD_BOSS
                    });
                    DBA.ExeSqlCommand(sqlCommand, "PublicDb");
                }
            }
            catch (Exception ex)
            {
                Form1.WriteLine(2, string.Concat(new object[]
                {
                    "增加怪 [",
                    Npcid,
                    "]出错：",
                    ex
                }));
            }
        }

        public static void 随机BOSS系统()
        {
            Random random = new Random();
            try
            {
                List<MonSterClss> list = new List<MonSterClss>();
                foreach (MonSterClss current in World.MonSter.Values)
                {
                    if (current.FLD_BOSS == 1)
                    {
                        list.Add(current);
                    }
                }
                int index = random.Next(0, list.Count);
                World.AddNpc(list[index].FLD_PID, (float)random.Next(420, 700), (float)random.Next(1700, 2000), 101);
                World.AddNpc(list[index].FLD_PID, (float)random.Next(420, 700), (float)random.Next(1700, 2000), 101);
                string msg = "泫勃派已经被BOSS侵袭，门主发出求救,赶紧带着小伙伴们去反击入侵者:" + list[index].Name;
                World.发送公告(msg);
            }
            catch (Exception arg)
            {
                Form1.WriteLine(1, "加载NPC数据 出错：" + arg);
            }
        }

        public static void ProcessSqlQueue()
        {
            try
            {
                if (World.jlMsg == 1)
                {
                    Form1.WriteLine(0, "ProcessSqlQueue111()");
                }
                while (World.SqlPool.Count > 0)
                {
                    if (World.jlMsg == 1)
                    {
                        Form1.WriteLine(0, "ProcessSqlQueue");
                    }
                    DbPoolClass dbPoolClass = (DbPoolClass)World.SqlPool.Dequeue();
                    try
                    {
                        if (DbPoolClass.DbPoolClassRun(dbPoolClass.Conn, dbPoolClass.Sql, dbPoolClass.Prams, dbPoolClass.Type) == -1)
                        {
                            Form1.WriteLine(1, "ProcessSqlQueue()2 数据库连接出错 " + World.SqlPool.Count);
                            Thread.Sleep(1);
                        }
                    }
                    catch (Exception arg)
                    {
                        Form1.WriteLine(1, "ProcessSqlQueue()1出错 " + arg);
                        Thread.Sleep(1);
                    }
                }
            }
            catch (Exception arg2)
            {
                Form1.WriteLine(1, "ProcessSqlQueue()出错 " + arg2);
            }
        }

        public static void ProcessDisposedQueue()
        {
            int num = 0;
            try
            {
                if (World.jlMsg == 1)
                {
                    Form1.WriteLine(0, "ProcessDisposedQueue111()");
                }
                int num2 = 0;
                while (num2 < 200 && World.m_Disposed.Count > 0)
                {
                    if (World.jlMsg == 1)
                    {
                        Form1.WriteLine(0, "ProcessDisposedQueue");
                    }
                    num2++;
                    NetState netState = (NetState)World.m_Disposed.Dequeue();
                    try
                    {
                        num = 1;
                        if (netState != null)
                        {
                            num = 2;
                            if (netState.在线)
                            {
                                netState.IDout();
                            }
                            num = 3;
                            if (netState.Player != null)
                            {
                                num = 4;
                                netState.Player.退出中 = true;
                                netState.Player.Logout();
                                num = 5;
                                netState.Player.Dispose();
                            }
                            num = 6;
                            if (World.allConnectedChars.ContainsKey(netState.WorldId))
                            {
                                num = 7;
                                World.allConnectedChars.Remove(netState.WorldId);
                            }
                            num = 8;
                            netState.Player = null;
                            num = 9;
                            netState.delWorldIdd();
                            num = 10;
                        }
                        else
                        {
                            Form1.WriteLine(1, "ns is null");
                        }
                    }
                    catch (Exception ex)
                    {
                        Form1.WriteLine(1, string.Concat(new object[]
                        {
                            "ProcessDisposedQueue()出错 ",
                            num,
                            "  ",
                            ex.Message
                        }));
                    }
                }
            }
            catch (Exception ex2)
            {
                Form1.WriteLine(1, string.Concat(new object[]
                {
                    "ProcessDisposedQueue()出错2 ",
                    num,
                    " 数据队列:",
                    World.m_Disposed.Count,
                    "  ",
                    ex2.Message
                }));
            }
        }

        public static string pWord(string sSource, int iFlag)
        {
            if (sSource == null)
            {
                return null;
            }
            if (sSource.Equals(""))
            {
                return "";
            }
            string text = "";
            if (iFlag == 2)
            {
                int length = sSource.Length;
                text = "";
                int num = Convert.ToInt32(sSource.ToCharArray(0, 1)[0]) % 10;
                for (int i = 2; i < length; i += 2)
                {
                    int num2 = Convert.ToInt32(sSource.ToCharArray(i, 1)[0]);
                    string str;
                    if (Convert.ToInt32(sSource.ToCharArray(i - 1, 1)[0]) % 2 == 0)
                    {
                        str = ((char)(num2 + (i - 1) / 2 + num)).ToString();
                    }
                    else
                    {
                        str = ((char)(num2 - (i - 1) / 2 - num)).ToString();
                    }
                    text += str;
                }
            }
            return text;
        }
    }
}
